Fix coding standards errors in Network/

This commit is contained in:
mark_story 2012-03-04 11:18:20 -05:00
parent 863aaad4e3
commit a6da736149
8 changed files with 24 additions and 18 deletions

View file

@ -29,6 +29,7 @@ App::uses('Set', 'Utility');
* @package Cake.Network
*/
class CakeRequest implements ArrayAccess {
/**
* Array of parameters parsed from the url.
*
@ -275,7 +276,7 @@ class CakeRequest implements ArrayAccess {
$base = '';
}
$this->webroot = $base .'/';
$this->webroot = $base . '/';
return $this->base = $base;
}
@ -292,7 +293,7 @@ class CakeRequest implements ArrayAccess {
if (!empty($base) || !$docRootContainsWebroot) {
if (strpos($this->webroot, '/' . $dir . '/') === false) {
$this->webroot .= $dir . '/' ;
$this->webroot .= $dir . '/';
}
if (strpos($this->webroot, '/' . $webroot . '/') === false) {
$this->webroot .= $webroot . '/';
@ -847,4 +848,5 @@ class CakeRequest implements ArrayAccess {
public function offsetUnset($name) {
unset($this->params[$name]);
}
}

View file

@ -89,7 +89,7 @@ class CakeResponse {
'cpio' => 'application/x-cpio',
'cpt' => 'application/mac-compactpro',
'csh' => 'application/x-csh',
'csv' => array('text/csv', 'application/vnd.ms-excel', 'text/plain'),
'csv' => array('text/csv', 'application/vnd.ms-excel', 'text/plain'),
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dms' => 'application/octet-stream',
@ -755,7 +755,7 @@ class CakeResponse {
if ($time == null) {
$this->_setCacheControl();
}
return (bool) $public;
return (bool)$public;
}
/**
@ -921,7 +921,7 @@ class CakeResponse {
**/
public function vary($cacheVariances = null) {
if ($cacheVariances !== null) {
$cacheVariances = (array) $cacheVariances;
$cacheVariances = (array)$cacheVariances;
$this->_headers['Vary'] = implode(', ', $cacheVariances);
}
if (isset($this->_headers['Vary'])) {
@ -961,7 +961,6 @@ class CakeResponse {
return null;
}
/**
* Returns a DateTime object initialized at the $time param and using UTC
* as timezone
@ -1151,4 +1150,5 @@ class CakeResponse {
$this->_cookies[$options['name']] = $options;
}
}

View file

@ -276,4 +276,5 @@ class CakeSocket {
}
return true;
}
}

View file

@ -242,7 +242,6 @@ class CakeEmail {
/**
* Charset the email body is sent in
*
*
* @var string
*/
public $charset = 'utf-8';
@ -250,15 +249,17 @@ class CakeEmail {
/**
* Charset the email header is sent in
* If null, the $charset property will be used as default
*
* @var string
*/
public $headerCharset = null;
/**
* The application wide charset, used to encode headers and body
*
* @var string
*/
public $_appCharset = null;
protected $_appCharset = null;
/**
* List of files that should be attached to the email.
@ -1019,6 +1020,8 @@ class CakeEmail {
* @param CakeEmail $obj CakeEmail
* @param array $config
* @return void
* @throws ConfigureException When configuration file cannot be found, or is missing
* the named config.
*/
protected function _applyConfig($config) {
if (is_string($config)) {
@ -1279,7 +1282,7 @@ class CakeEmail {
protected function _readFile($file) {
$handle = fopen($file, 'rb');
$data = fread($handle, filesize($file));
$data = chunk_split(base64_encode($data)) ;
$data = chunk_split(base64_encode($data));
fclose($handle);
return $data;
}
@ -1359,7 +1362,7 @@ class CakeEmail {
$msg = array_merge($msg, $content);
$msg[] = '';
}
if (isset($rendered['html'])) {
if ($textBoundary !== $boundary || $hasAttachments) {
$msg[] = '--' . $textBoundary;
@ -1451,7 +1454,7 @@ class CakeEmail {
$View->set('content', $content);
$View->hasRendered = false;
$View->viewPath = $View->layoutPath = 'Emails' . DS . $type;
$render = $View->render($template, $layout);
$render = str_replace(array("\r\n", "\r"), "\n", $render);
$rendered[$type] = $this->_encodeString($render, $this->charset);
@ -1471,4 +1474,5 @@ class CakeEmail {
}
return '7bit';
}
}

View file

@ -29,6 +29,7 @@ class MailTransport extends AbstractTransport {
*
* @param CakeEmail $email CakeEmail
* @return array
* @throws SocketException When mail cannot be sent.
*/
public function send(CakeEmail $email) {
$eol = PHP_EOL;

View file

@ -101,4 +101,5 @@ class DigestAuthentication {
}
return $authHeader;
}
}

View file

@ -123,7 +123,7 @@ class HttpResponse implements ArrayAccess {
public function isOk() {
return $this->code == 200;
}
/**
* If return is a valid 3xx (Redirection)
*
@ -238,9 +238,7 @@ class HttpResponse implements ArrayAccess {
$chunkLength = hexdec($hexLength);
$chunk = substr($body, 0, $chunkLength);
if (!empty($chunkExtensionName)) {
/**
* @todo See if there are popular chunk extensions we should implement
*/
// @todo See if there are popular chunk extensions we should implement
}
$decodedBody .= $chunk;
if ($chunkLength !== 0) {
@ -427,7 +425,6 @@ class HttpResponse implements ArrayAccess {
* @return void
*/
public function offsetSet($offset, $value) {
return;
}
/**
@ -437,7 +434,6 @@ class HttpResponse implements ArrayAccess {
* @return void
*/
public function offsetUnset($offset) {
return;
}
/**

View file

@ -603,7 +603,7 @@ class HttpSocket extends CakeSocket {
}
list($plugin, $authClass) = pluginSplit($this->_proxy['method'], true);
$authClass = Inflector::camelize($authClass) . 'Authentication';
App::uses($authClass, $plugin. 'Network/Http');
App::uses($authClass, $plugin . 'Network/Http');
if (!class_exists($authClass)) {
throw new SocketException(__d('cake_dev', 'Unknown authentication method for proxy.'));
@ -926,4 +926,5 @@ class HttpSocket extends CakeSocket {
parent::reset($initalState);
return true;
}
}