Adhering to coding standards

This commit is contained in:
Kyle Robinson Young 2011-11-30 07:44:11 -08:00
parent 32a3737cca
commit 5876744709
31 changed files with 51 additions and 52 deletions

View file

@ -79,7 +79,7 @@ class BakeTask extends AppShell {
* @return void * @return void
*/ */
public function execute() { public function execute() {
foreach($this->args as $i => $arg) { foreach ($this->args as $i => $arg) {
if (strpos($arg, '.')) { if (strpos($arg, '.')) {
list($this->params['plugin'], $this->args[$i]) = pluginSplit($arg); list($this->params['plugin'], $this->args[$i]) = pluginSplit($arg);
break; break;

View file

@ -159,8 +159,8 @@ class PluginTask extends AppShell {
*/ */
public function findPath($pathOptions) { public function findPath($pathOptions) {
$valid = false; $valid = false;
foreach ($pathOptions as $i =>$path) { foreach ($pathOptions as $i => $path) {
if(!is_dir($path)) { if (!is_dir($path)) {
array_splice($pathOptions, $i, 1); array_splice($pathOptions, $i, 1);
} }
} }

View file

@ -83,7 +83,7 @@ class UpgradeShell extends AppShell {
* @return void * @return void
*/ */
public function all() { public function all() {
foreach($this->OptionParser->subcommands() as $command) { foreach ($this->OptionParser->subcommands() as $command) {
$name = $command->name(); $name = $command->name();
if ($name === 'all') { if ($name === 'all') {
continue; continue;
@ -135,7 +135,7 @@ class UpgradeShell extends AppShell {
if (is_dir('plugins')) { if (is_dir('plugins')) {
$Folder = new Folder('plugins'); $Folder = new Folder('plugins');
list($plugins) = $Folder->read(); list($plugins) = $Folder->read();
foreach($plugins as $plugin) { foreach ($plugins as $plugin) {
chdir($cwd . DS . 'plugins' . DS . $plugin); chdir($cwd . DS . 'plugins' . DS . $plugin);
$this->locations(); $this->locations();
} }
@ -155,7 +155,7 @@ class UpgradeShell extends AppShell {
'Test' . DS . 'fixtures' => 'Test' . DS . 'Fixture', 'Test' . DS . 'fixtures' => 'Test' . DS . 'Fixture',
'vendors' . DS . 'shells' . DS . 'templates' => 'Console' . DS . 'Templates', 'vendors' . DS . 'shells' . DS . 'templates' => 'Console' . DS . 'Templates',
); );
foreach($moves as $old => $new) { foreach ($moves as $old => $new) {
if (is_dir($old)) { if (is_dir($old)) {
$this->out(__d('cake_console', 'Moving %s to %s', $old, $new)); $this->out(__d('cake_console', 'Moving %s to %s', $old, $new));
if (!$this->params['dry-run']) { if (!$this->params['dry-run']) {
@ -190,7 +190,7 @@ class UpgradeShell extends AppShell {
'checkFolder' => true, 'checkFolder' => true,
'regex' => '@class (\S*) .*{@i' 'regex' => '@class (\S*) .*{@i'
); );
foreach($sourceDirs as $dir => $options) { foreach ($sourceDirs as $dir => $options) {
if (is_numeric($dir)) { if (is_numeric($dir)) {
$dir = $options; $dir = $options;
$options = array(); $options = array();
@ -614,7 +614,7 @@ class UpgradeShell extends AppShell {
$this->_findFiles('php'); $this->_findFiles('php');
} else { } else {
$this->_files = scandir($path); $this->_files = scandir($path);
foreach($this->_files as $i => $file) { foreach ($this->_files as $i => $file) {
if (strlen($file) < 5 || substr($file, -4) !== '.php') { if (strlen($file) < 5 || substr($file, -4) !== '.php') {
unset($this->_files[$i]); unset($this->_files[$i]);
} }

View file

@ -140,7 +140,7 @@ class HelpFormatter {
foreach ($this->_parser->options() as $option) { foreach ($this->_parser->options() as $option) {
$options[] = $option->usage(); $options[] = $option->usage();
} }
if (count($options) > $this->_maxOptions){ if (count($options) > $this->_maxOptions) {
$options = array('[options]'); $options = array('[options]');
} }
$usage = array_merge($usage, $options); $usage = array_merge($usage, $options);

View file

@ -55,7 +55,7 @@ class CakeErrorController extends AppController {
public function beforeRender() { public function beforeRender() {
parent::beforeRender(); parent::beforeRender();
foreach ($this->viewVars as $key => $value) { foreach ($this->viewVars as $key => $value) {
if (!is_object($value)){ if (!is_object($value)) {
$this->viewVars[$key] = h($value); $this->viewVars[$key] = h($value);
} }
} }

View file

@ -567,7 +567,7 @@ class Mysql extends DboSource {
protected function _alterIndexes($table, $indexes) { protected function _alterIndexes($table, $indexes) {
$alter = array(); $alter = array();
if (isset($indexes['drop'])) { if (isset($indexes['drop'])) {
foreach($indexes['drop'] as $name => $value) { foreach ($indexes['drop'] as $name => $value) {
$out = 'DROP '; $out = 'DROP ';
if ($name == 'PRIMARY') { if ($name == 'PRIMARY') {
$out .= 'PRIMARY KEY'; $out .= 'PRIMARY KEY';

View file

@ -409,7 +409,7 @@ class Postgres extends DboSource {
if (!$constant && strpos($match[1], '.') === false) { if (!$constant && strpos($match[1], '.') === false) {
$match[1] = $this->name($match[1]); $match[1] = $this->name($match[1]);
} elseif (!$constant){ } elseif (!$constant) {
$parts = explode('.', $match[1]); $parts = explode('.', $match[1]);
if (!Set::numeric($parts)) { if (!Set::numeric($parts)) {
$match[1] = $this->name($match[1]); $match[1] = $this->name($match[1]);
@ -550,7 +550,7 @@ class Postgres extends DboSource {
protected function _alterIndexes($table, $indexes) { protected function _alterIndexes($table, $indexes) {
$alter = array(); $alter = array();
if (isset($indexes['drop'])) { if (isset($indexes['drop'])) {
foreach($indexes['drop'] as $name => $value) { foreach ($indexes['drop'] as $name => $value) {
$out = 'DROP '; $out = 'DROP ';
if ($name == 'PRIMARY') { if ($name == 'PRIMARY') {
continue; continue;

View file

@ -286,9 +286,9 @@ class Sqlite extends DboSource {
} }
} elseif (strpos($querystring, 'PRAGMA table_info') === 0) { } elseif (strpos($querystring, 'PRAGMA table_info') === 0) {
$selects = array('cid', 'name', 'type', 'notnull', 'dflt_value', 'pk'); $selects = array('cid', 'name', 'type', 'notnull', 'dflt_value', 'pk');
} elseif(strpos($querystring, 'PRAGMA index_list') === 0) { } elseif (strpos($querystring, 'PRAGMA index_list') === 0) {
$selects = array('seq', 'name', 'unique'); $selects = array('seq', 'name', 'unique');
} elseif(strpos($querystring, 'PRAGMA index_info') === 0) { } elseif (strpos($querystring, 'PRAGMA index_info') === 0) {
$selects = array('seqno', 'cid', 'name'); $selects = array('seqno', 'cid', 'name');
} }
while ($j < $num_fields) { while ($j < $num_fields) {

View file

@ -1947,7 +1947,7 @@ class DboSource extends DataSource {
if (!isset($params[1])) { if (!isset($params[1])) {
$params[1] = 'count'; $params[1] = 'count';
} }
if (is_object($model) && $model->isVirtualField($params[0])){ if (is_object($model) && $model->isVirtualField($params[0])) {
$arg = $this->_quoteFields($model->getVirtualField($params[0])); $arg = $this->_quoteFields($model->getVirtualField($params[0]));
} else { } else {
$arg = $this->name($params[0]); $arg = $this->name($params[0]);
@ -2191,7 +2191,7 @@ class DboSource extends DataSource {
} }
if (is_object($fields[$i]) && isset($fields[$i]->type) && $fields[$i]->type === 'expression') { if (is_object($fields[$i]) && isset($fields[$i]->type) && $fields[$i]->type === 'expression') {
$fields[$i] = $fields[$i]->value; $fields[$i] = $fields[$i]->value;
} elseif (preg_match('/^\(.*\)\s' . $this->alias . '.*/i', $fields[$i])){ } elseif (preg_match('/^\(.*\)\s' . $this->alias . '.*/i', $fields[$i])) {
continue; continue;
} elseif (!preg_match('/^.+\\(.*\\)/', $fields[$i])) { } elseif (!preg_match('/^.+\\(.*\\)/', $fields[$i])) {
$prepend = ''; $prepend = '';
@ -2622,7 +2622,7 @@ class DboSource extends DataSource {
if (!is_array($group)) { if (!is_array($group)) {
$group = array($group); $group = array($group);
} }
foreach($group as $index => $key) { foreach ($group as $index => $key) {
if (is_object($model) && $model->isVirtualField($key)) { if (is_object($model) && $model->isVirtualField($key)) {
$group[$index] = '(' . $model->getVirtualField($key) . ')'; $group[$index] = '(' . $model->getVirtualField($key) . ')';
} }

View file

@ -47,13 +47,13 @@ class DatabaseSession implements CakeSessionHandlerInterface {
if (empty($modelName)) { if (empty($modelName)) {
$settings = array( $settings = array(
'class' =>'Session', 'class' => 'Session',
'alias' => 'Session', 'alias' => 'Session',
'table' => 'cake_sessions', 'table' => 'cake_sessions',
); );
} else { } else {
$settings = array( $settings = array(
'class' =>$modelName, 'class' => $modelName,
'alias' => 'Session', 'alias' => 'Session',
); );
} }

View file

@ -2136,7 +2136,7 @@ class Model extends Object {
if (in_array($associations[$association], array('belongsTo', 'hasOne'))) { if (in_array($associations[$association], array('belongsTo', 'hasOne'))) {
$validates = $this->{$association}->create($values) && $this->{$association}->validates($options); $validates = $this->{$association}->create($values) && $this->{$association}->validates($options);
$return[$association][] = $validates; $return[$association][] = $validates;
} elseif($associations[$association] === 'hasMany') { } elseif ($associations[$association] === 'hasMany') {
$validates = $this->{$association}->validateMany($values, $options); $validates = $this->{$association}->validateMany($values, $options);
$return[$association] = $validates; $return[$association] = $validates;
} }

View file

@ -229,7 +229,7 @@ class CakeRoute {
// restructure 'pass' key route params // restructure 'pass' key route params
if (isset($this->options['pass'])) { if (isset($this->options['pass'])) {
$j = count($this->options['pass']); $j = count($this->options['pass']);
while($j--) { while ($j--) {
if (isset($route[$this->options['pass'][$j]])) { if (isset($route[$this->options['pass'][$j]])) {
array_unshift($route['pass'], $route[$this->options['pass'][$j]]); array_unshift($route['pass'], $route[$this->options['pass'][$j]]);
} }

View file

@ -102,7 +102,7 @@ class MemcacheEngineTest extends CakeTestCase {
$available = true; $available = true;
$Memcache = new Memcache(); $Memcache = new Memcache();
foreach($servers as $server) { foreach ($servers as $server) {
list($host, $port) = explode(':', $server); list($host, $port) = explode(':', $server);
if (!@$Memcache->connect($host, $port)) { if (!@$Memcache->connect($host, $port)) {
$available = false; $available = false;

View file

@ -2603,7 +2603,7 @@ class I18nTest extends CakeTestCase {
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
} }
public function testTimeDefinitionJapanese(){ public function testTimeDefinitionJapanese() {
Configure::write('Config.language', 'ja_jp'); Configure::write('Config.language', 'ja_jp');
$result = __c('d_fmt', 5); $result = __c('d_fmt', 5);

View file

@ -2921,8 +2921,8 @@ class ContainableBehaviorTest extends CakeTestCase {
'order' => array('Article.id' => 'ASC') 'order' => array('Article.id' => 'ASC')
)); ));
if (!empty($result)) { if (!empty($result)) {
foreach($result as $i=>$article) { foreach ($result as $i => $article) {
foreach($article['Comment'] as $j=>$comment) { foreach ($article['Comment'] as $j => $comment) {
$result[$i]['Comment'][$j] = array_diff_key($comment, array('id'=>true)); $result[$i]['Comment'][$j] = array_diff_key($comment, array('id'=>true));
} }
} }
@ -3628,7 +3628,7 @@ class ContainableBehaviorTest extends CakeTestCase {
return $this->__containments($result['models']); return $this->__containments($result['models']);
} else { } else {
$result = $Model; $result = $Model;
foreach($result as $i => $containment) { foreach ($result as $i => $containment) {
$result[$i] = array_diff_key($containment, array('instance' => true)); $result[$i] = array_diff_key($containment, array('instance' => true));
} }
} }
@ -3646,7 +3646,7 @@ class ContainableBehaviorTest extends CakeTestCase {
function __assertBindings(&$Model, $expected = array()) { function __assertBindings(&$Model, $expected = array()) {
$expected = array_merge(array('belongsTo' => array(), 'hasOne' => array(), 'hasMany' => array(), 'hasAndBelongsToMany' => array()), $expected); $expected = array_merge(array('belongsTo' => array(), 'hasOne' => array(), 'hasMany' => array(), 'hasAndBelongsToMany' => array()), $expected);
foreach($expected as $binding => $expect) { foreach ($expected as $binding => $expect) {
$this->assertEquals(array_keys($Model->$binding), $expect); $this->assertEquals(array_keys($Model->$binding), $expect);
} }
} }
@ -3664,14 +3664,14 @@ class ContainableBehaviorTest extends CakeTestCase {
$debug = '['; $debug = '[';
$lines = array(); $lines = array();
foreach($relationTypes as $binding) { foreach ($relationTypes as $binding) {
if (!empty($Model->$binding)) { if (!empty($Model->$binding)) {
$models = array_keys($Model->$binding); $models = array_keys($Model->$binding);
foreach($models as $linkedModel) { foreach ($models as $linkedModel) {
$line = $linkedModel; $line = $linkedModel;
if (!empty($extra) && !empty($Model->{$binding}[$linkedModel])) { if (!empty($extra) && !empty($Model->{$binding}[$linkedModel])) {
$extraData = array(); $extraData = array();
foreach(array_intersect_key($Model->{$binding}[$linkedModel], array_flip($extra)) as $key => $value) { foreach (array_intersect_key($Model->{$binding}[$linkedModel], array_flip($extra)) as $key => $value) {
$extraData[] = $key . ': ' . (is_array($value) ? '(' . implode(', ', $value) . ')' : $value); $extraData[] = $key . ': ' . (is_array($value) ? '(' . implode(', ', $value) . ')' : $value);
} }
$line .= ' {' . implode(' - ', $extraData) . '}'; $line .= ' {' . implode(' - ', $extraData) . '}';

View file

@ -131,7 +131,7 @@ class ModelReadTest extends BaseModelTest {
'fields' => array('Thread.project_id', 'COUNT(*) AS total') 'fields' => array('Thread.project_id', 'COUNT(*) AS total')
)); ));
$result = array(); $result = array();
foreach($rows as $row) { foreach ($rows as $row) {
$result[$row['Thread']['project_id']] = $row[0]['total']; $result[$row['Thread']['project_id']] = $row[0]['total'];
} }
$expected = array( $expected = array(
@ -146,7 +146,7 @@ class ModelReadTest extends BaseModelTest {
'order'=> 'Thread.project_id' 'order'=> 'Thread.project_id'
)); ));
$result = array(); $result = array();
foreach($rows as $row) { foreach ($rows as $row) {
$result[$row['Thread']['project_id']] = $row[0]['total']; $result[$row['Thread']['project_id']] = $row[0]['total'];
} }
$expected = array( $expected = array(

View file

@ -899,7 +899,7 @@ class ModifiedAuthor extends Author {
* @return void * @return void
*/ */
public function afterFind($results, $primary = false) { public function afterFind($results, $primary = false) {
foreach($results as $index => $result) { foreach ($results as $index => $result) {
$results[$index]['Author']['user'] .= ' (CakePHP)'; $results[$index]['Author']['user'] .= ' (CakePHP)';
} }
return $results; return $results;

View file

@ -20,7 +20,7 @@ App::uses('Dispatcher', 'Routing');
if (!class_exists('AppController', false)) { if (!class_exists('AppController', false)) {
require_once CAKE . 'Controller' . DS . 'AppController.php'; require_once CAKE . 'Controller' . DS . 'AppController.php';
} elseif (!defined('APP_CONTROLLER_EXISTS')){ } elseif (!defined('APP_CONTROLLER_EXISTS')) {
define('APP_CONTROLLER_EXISTS', true); define('APP_CONTROLLER_EXISTS', true);
} }

View file

@ -2403,7 +2403,7 @@ class SetTest extends CakeTestCase {
$mapped = Set::map($expected); $mapped = Set::map($expected);
$ids = array(); $ids = array();
foreach($mapped as $object) { foreach ($mapped as $object) {
$ids[] = $object->id; $ids[] = $object->id;
} }
$this->assertEquals($ids, array(1, 2)); $this->assertEquals($ids, array(1, 2));
@ -2451,7 +2451,7 @@ class SetTest extends CakeTestCase {
$ids = array(); $ids = array();
foreach($mapped as $object) { foreach ($mapped as $object) {
$ids[] = $object->id; $ids[] = $object->id;
} }
$this->assertEquals($ids, array(1, 2)); $this->assertEquals($ids, array(1, 2));

View file

@ -47,7 +47,7 @@ class StringTest extends CakeTestCase {
$count = mt_rand(10, 1000); $count = mt_rand(10, 1000);
$pattern = "/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/"; $pattern = "/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/";
for($i = 0; $i < $count; $i++) { for ($i = 0; $i < $count; $i++) {
$result = String::uuid(); $result = String::uuid();
$match = (bool) preg_match($pattern, $result); $match = (bool) preg_match($pattern, $result);
$this->assertTrue($match); $this->assertTrue($match);

View file

@ -868,7 +868,7 @@ class XmlTest extends CakeTestCase {
//multiple model results - without a records key it would fatal error //multiple model results - without a records key it would fatal error
$data = $user->find('all', array('limit'=>2)); $data = $user->find('all', array('limit'=>2));
$data = array('records'=>$data); $data = array('records' => $data);
$obj = Xml::build(compact('data')); $obj = Xml::build(compact('data'));
$expected = '<' . '?xml version="1.0" encoding="UTF-8"?><data>'; $expected = '<' . '?xml version="1.0" encoding="UTF-8"?><data>';
$expected .= '<records>'; $expected .= '<records>';

View file

@ -279,7 +279,7 @@ class PaginatorHelperTest extends CakeTestCase {
* *
* @return void * @return void
*/ */
public function testSortLinksUsingDirectionOption(){ public function testSortLinksUsingDirectionOption() {
Router::reload(); Router::reload();
Router::parse('/'); Router::parse('/');
Router::setRequestInfo(array( Router::setRequestInfo(array(

View file

@ -116,7 +116,7 @@ class TimeHelperTest extends CakeTestCase {
$result = $this->Time->timeAgoInWords(strtotime('+1 month +1 week +6 days'), array('end' => '8 years'), true); $result = $this->Time->timeAgoInWords(strtotime('+1 month +1 week +6 days'), array('end' => '8 years'), true);
$this->assertEquals($result, '1 month, 1 week, 6 days'); $this->assertEquals($result, '1 month, 1 week, 6 days');
for($i = 0; $i < 200; $i ++) { for ($i = 0; $i < 200; $i ++) {
$years = mt_rand(0, 3); $years = mt_rand(0, 3);
$months = mt_rand(0, 11); $months = mt_rand(0, 11);
$weeks = mt_rand(0, 3); $weeks = mt_rand(0, 3);
@ -411,7 +411,7 @@ class TimeHelperTest extends CakeTestCase {
if (!$this->skipIf(!class_exists('DateTimeZone'), '%s DateTimeZone class not available.')) { if (!$this->skipIf(!class_exists('DateTimeZone'), '%s DateTimeZone class not available.')) {
$timezones = array('Europe/London', 'Europe/Brussels', 'UTC', 'America/Denver', 'America/Caracas', 'Asia/Kathmandu'); $timezones = array('Europe/London', 'Europe/Brussels', 'UTC', 'America/Denver', 'America/Caracas', 'Asia/Kathmandu');
foreach($timezones as $timezone) { foreach ($timezones as $timezone) {
$yourTimezone = new DateTimeZone($timezone); $yourTimezone = new DateTimeZone($timezone);
$yourTime = new DateTime('now', $yourTimezone); $yourTime = new DateTime('now', $yourTimezone);
$userOffset = $yourTimezone->getOffset($yourTime) / HOUR; $userOffset = $yourTimezone->getOffset($yourTime) / HOUR;

View file

@ -228,7 +228,7 @@ class CakeTestSuiteDispatcher {
function _runTestCase() { function _runTestCase() {
$commandArgs = array( $commandArgs = array(
'case' => $this->params['case'], 'case' => $this->params['case'],
'core' =>$this->params['core'], 'core' => $this->params['core'],
'app' => $this->params['app'], 'app' => $this->params['app'],
'plugin' => $this->params['plugin'], 'plugin' => $this->params['plugin'],
'codeCoverage' => $this->params['codeCoverage'], 'codeCoverage' => $this->params['codeCoverage'],

View file

@ -144,7 +144,7 @@ class CakeTestFixture {
if (empty($this->fields['tableParameters']['engine'])) { if (empty($this->fields['tableParameters']['engine'])) {
$canUseMemory = true; $canUseMemory = true;
foreach($this->fields as $field => $args) { foreach ($this->fields as $field => $args) {
if (is_string($args)) { if (is_string($args)) {
$type = $args; $type = $args;
@ -205,7 +205,7 @@ class CakeTestFixture {
$values = array(); $values = array();
if (isset($this->records) && !empty($this->records)) { if (isset($this->records) && !empty($this->records)) {
$fields = array(); $fields = array();
foreach($this->records as $record) { foreach ($this->records as $record) {
$fields = array_merge($fields, array_keys(array_intersect_key($record, $this->fields))); $fields = array_merge($fields, array_keys(array_intersect_key($record, $this->fields)));
} }
$fields = array_unique($fields); $fields = array_unique($fields);

View file

@ -39,7 +39,7 @@ class CakeTestModel extends Model {
public function beforeFind($queryData) { public function beforeFind($queryData) {
$pk = $this->primaryKey; $pk = $this->primaryKey;
$aliasedPk = $this->alias . '.' . $this->primaryKey; $aliasedPk = $this->alias . '.' . $this->primaryKey;
switch(true) { switch (true) {
case !$pk: case !$pk:
case !$this->useTable: case !$this->useTable:
case !$this->schema('id'): case !$this->schema('id'):

View file

@ -30,7 +30,7 @@ if (!empty($plugins)):
?> ?>
<li style="padding-top: 10px"> <li style="padding-top: 10px">
<span style="font-size: 18px">Plugins</span> <span style="font-size: 18px">Plugins</span>
<?php foreach($plugins as $plugin): ?> <?php foreach ($plugins as $plugin): ?>
<ul> <ul>
<li style="padding-top: 10px"> <li style="padding-top: 10px">
<span style="font-size: 18px"><?php echo $plugin;?></span> <span style="font-size: 18px"><?php echo $plugin;?></span>

View file

@ -1208,7 +1208,7 @@ class FormHelper extends AppHelper {
*/ */
public function checkbox($fieldName, $options = array()) { public function checkbox($fieldName, $options = array()) {
$valueOptions = array(); $valueOptions = array();
if(isset($options['default'])){ if (isset($options['default'])) {
$valueOptions['default'] = $options['default']; $valueOptions['default'] = $options['default'];
unset($options['default']); unset($options['default']);
} }

View file

@ -247,7 +247,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
if (isset($options['update'])) { if (isset($options['update'])) {
$wrapCallbacks = isset($options['wrapCallbacks']) ? $options['wrapCallbacks'] : true; $wrapCallbacks = isset($options['wrapCallbacks']) ? $options['wrapCallbacks'] : true;
$success = ''; $success = '';
if(isset($options['success']) AND !empty($options['success'])) { if (isset($options['success']) AND !empty($options['success'])) {
$success .= $options['success']; $success .= $options['success'];
} }
$success .= $this->jQueryObject . '("' . $options['update'] . '").html(data);'; $success .= $this->jQueryObject . '("' . $options['update'] . '").html(data);';

View file

@ -459,8 +459,8 @@ class TimeHelper extends AppHelper {
public function toRSS($dateString, $userOffset = null) { public function toRSS($dateString, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset); $date = $this->fromString($dateString, $userOffset);
if(!is_null($userOffset)) { if (!is_null($userOffset)) {
if($userOffset == 0) { if ($userOffset == 0) {
$timezone = '+0000'; $timezone = '+0000';
} else { } else {
$hours = (int) floor(abs($userOffset)); $hours = (int) floor(abs($userOffset));

View file

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Basic Cake functionality. * Basic Cake functionality.
* *