diff --git a/lib/Cake/Cache/Engine/XcacheEngine.php b/lib/Cake/Cache/Engine/XcacheEngine.php index 72100f76d0c..950d479456d 100644 --- a/lib/Cake/Cache/Engine/XcacheEngine.php +++ b/lib/Cake/Cache/Engine/XcacheEngine.php @@ -165,7 +165,7 @@ protected function _auth($reverse = false) { } if (!empty($this->settings[$setting])) { $_SERVER[$key] = $this->settings[$setting]; - } else if (!empty($this->settings[$key])) { + } elseif (!empty($this->settings[$key])) { $_SERVER[$key] = $this->settings[$key]; } else { $_SERVER[$key] = $value; diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php index c9cdfd05742..45367f16df5 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -100,7 +100,7 @@ protected function _interactive() { if (preg_match('/[^a-z0-9_]/i', $name)) { $name = ''; $this->out(__d('cake_console', 'The name may only contain unaccented latin characters, numbers or underscores')); - } else if (preg_match('/^[^a-z_]/i', $name)) { + } elseif (preg_match('/^[^a-z_]/i', $name)) { $name = ''; $this->out(__d('cake_console', 'The name must start with an unaccented latin character or an underscore')); } diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index 5024478c6ca..bf7547f0749 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -118,7 +118,7 @@ public function execute() { } if (isset($this->params['paths'])) { $this->_paths = explode(',', $this->params['paths']); - } else if (isset($this->params['plugin'])) { + } elseif (isset($this->params['plugin'])) { $plugin = Inflector::camelize($this->params['plugin']); if (!CakePlugin::loaded($plugin)) { CakePlugin::load($plugin); @@ -159,7 +159,7 @@ public function execute() { if (isset($this->params['output'])) { $this->_output = $this->params['output']; - } else if (isset($this->params['plugin'])) { + } elseif (isset($this->params['plugin'])) { $this->_output = $this->_paths[0] . DS . 'Locale'; } else { $message = __d('cake_console', "What is the path you would like to output?\n[Q]uit", $this->_paths[0] . DS . 'Locale'); @@ -594,7 +594,7 @@ protected function _getStrings(&$position, $target) { $position++; } $strings[] = $string; - } else if ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING) { + } elseif ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING) { $strings[] = $this->_formatString($this->_tokens[$position][1]); } $position++; diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index 6d37fbd3e46..faf4afb45e7 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -652,7 +652,7 @@ public static function import($type = null, $name = null, $parent = true, $searc protected static function _loadClass($name, $plugin, $type, $originalType, $parent) { if ($type == 'Console/Command' && $name == 'Shell') { $type = 'Console'; - } else if (isset(self::$types[$originalType]['suffix'])) { + } elseif (isset(self::$types[$originalType]['suffix'])) { $suffix = self::$types[$originalType]['suffix']; $name .= ($suffix == $name) ? '' : $suffix; } @@ -691,7 +691,7 @@ protected static function _loadFile($name, $plugin, $search, $file, $return) { $mapped = self::_mapped($name, $plugin); if ($mapped) { $file = $mapped; - } else if (!empty($search)) { + } elseif (!empty($search)) { foreach ($search as $path) { $found = false; if (file_exists($path . $file)) { diff --git a/lib/Cake/Event/CakeEventManager.php b/lib/Cake/Event/CakeEventManager.php index cb29d4e7e4c..b141d891572 100644 --- a/lib/Cake/Event/CakeEventManager.php +++ b/lib/Cake/Event/CakeEventManager.php @@ -126,7 +126,7 @@ protected function _attachSubscriber(CakeEventListener $subscriber) { $method = $function; if (is_array($function) && isset($function['callable'])) { list($method, $options) = $this->_extractCallable($function, $subscriber); - } else if (is_array($function) && is_numeric(key($function))) { + } elseif (is_array($function) && is_numeric(key($function))) { foreach ($function as $f) { list($method, $options) = $this->_extractCallable($f, $subscriber); $this->attach($method, $eventKey, $options); @@ -198,7 +198,7 @@ protected function _detachSubscriber(CakeEventListener $subscriber, $eventKey = $events = $subscriber->implementedEvents(); if (!empty($eventKey) && empty($events[$eventKey])) { return; - } else if (!empty($eventKey)) { + } elseif (!empty($eventKey)) { $events = array($eventKey => $events[$eventKey]); } foreach ($events as $key => $function) { diff --git a/lib/Cake/I18n/L10n.php b/lib/Cake/I18n/L10n.php index 9c973b0a727..b621c06b3af 100644 --- a/lib/Cake/I18n/L10n.php +++ b/lib/Cake/I18n/L10n.php @@ -355,9 +355,9 @@ protected function _setLanguage($language = null) { $langKey = null; if ($language !== null && isset($this->_l10nMap[$language]) && isset($this->_l10nCatalog[$this->_l10nMap[$language]])) { $langKey = $this->_l10nMap[$language]; - } else if ($language !== null && isset($this->_l10nCatalog[$language])) { + } elseif ($language !== null && isset($this->_l10nCatalog[$language])) { $langKey = $language; - } else if (defined('DEFAULT_LANGUAGE')) { + } elseif (defined('DEFAULT_LANGUAGE')) { $langKey = $language = DEFAULT_LANGUAGE; } @@ -379,7 +379,7 @@ protected function _setLanguage($language = null) { if ($this->default) { if (isset($this->_l10nMap[$this->default]) && isset($this->_l10nCatalog[$this->_l10nMap[$this->default]])) { $this->languagePath[] = $this->_l10nCatalog[$this->_l10nMap[$this->default]]['localeFallback']; - } else if (isset($this->_l10nCatalog[$this->default])) { + } elseif (isset($this->_l10nCatalog[$this->default])) { $this->languagePath[] = $this->_l10nCatalog[$this->default]['localeFallback']; } } @@ -405,7 +405,7 @@ protected function _autoLanguage() { if (isset($this->_l10nCatalog[$langKey])) { $this->_setLanguage($langKey); return true; - } else if (strpos($langKey, '-') !== false) { + } elseif (strpos($langKey, '-') !== false) { $langKey = substr($langKey, 0, 2); if (isset($this->_l10nCatalog[$langKey])) { $this->_setLanguage($langKey); @@ -432,10 +432,10 @@ public function map($mixed = null) { } } return $result; - } else if (is_string($mixed)) { + } elseif (is_string($mixed)) { if (strlen($mixed) === 2 && in_array($mixed, $this->_l10nMap)) { return array_search($mixed, $this->_l10nMap); - } else if (isset($this->_l10nMap[$mixed])) { + } elseif (isset($this->_l10nMap[$mixed])) { return $this->_l10nMap[$mixed]; } return false; @@ -459,10 +459,10 @@ public function catalog($language = null) { } } return $result; - } else if (is_string($language)) { + } elseif (is_string($language)) { if (isset($this->_l10nCatalog[$language])) { return $this->_l10nCatalog[$language]; - } else if (isset($this->_l10nMap[$language]) && isset($this->_l10nCatalog[$this->_l10nMap[$language]])) { + } elseif (isset($this->_l10nMap[$language]) && isset($this->_l10nCatalog[$this->_l10nMap[$language]])) { return $this->_l10nCatalog[$this->_l10nMap[$language]]; } return false; diff --git a/lib/Cake/Model/Behavior/ContainableBehavior.php b/lib/Cake/Model/Behavior/ContainableBehavior.php index fbffc781ff3..cce1b4a9642 100644 --- a/lib/Cake/Model/Behavior/ContainableBehavior.php +++ b/lib/Cake/Model/Behavior/ContainableBehavior.php @@ -156,7 +156,7 @@ public function beforeFind($Model, $query) { } if (!$reset && empty($instance->__backOriginalAssociation)) { $instance->__backOriginalAssociation = $backupBindings; - } else if ($reset) { + } elseif ($reset) { $instance->__backAssociation[$type] = $backupBindings[$type]; } $instance->{$type}[$assoc] = array_merge($instance->{$type}[$assoc], $model['keep'][$assoc]); @@ -198,7 +198,7 @@ public function beforeFind($Model, $query) { foreach ($mandatory[$Model->alias] as $field) { if ($field == '--primaryKey--') { $field = $Model->primaryKey; - } else if (preg_match('/^.+\.\-\-[^-]+\-\-$/', $field)) { + } elseif (preg_match('/^.+\.\-\-[^-]+\-\-$/', $field)) { list($modelName, $field) = explode('.', $field); if ($Model->useDbConfig == $Model->{$modelName}->useDbConfig) { $field = $modelName . '.' . ( @@ -372,7 +372,7 @@ public function fieldDependencies($Model, $map, $fields = array()) { foreach ($bindings as $dependency) { if ($type == 'hasAndBelongsToMany') { $fields[$parent][] = '--primaryKey--'; - } else if ($type == 'belongsTo') { + } elseif ($type == 'belongsTo') { $fields[$parent][] = $dependency . '.--primaryKey--'; } } diff --git a/lib/Cake/Model/Behavior/TranslateBehavior.php b/lib/Cake/Model/Behavior/TranslateBehavior.php index 9705d0f76ae..392068f1bc6 100644 --- a/lib/Cake/Model/Behavior/TranslateBehavior.php +++ b/lib/Cake/Model/Behavior/TranslateBehavior.php @@ -143,7 +143,7 @@ public function beforeFind($model, $query) { $addFields = array(); if (empty($query['fields'])) { $addFields = $fields; - } else if (is_array($query['fields'])) { + } elseif (is_array($query['fields'])) { foreach ($fields as $key => $value) { $field = (is_numeric($key)) ? $value : $key; diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index 72694a238f4..a92eca848b6 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -575,7 +575,7 @@ protected function _values($values) { foreach ($values as $key => $val) { if (is_array($val)) { $vals[] = "'{$key}' => array('" . implode("', '", $val) . "')"; - } else if (!is_numeric($key)) { + } elseif (!is_numeric($key)) { $val = var_export($val, true); $vals[] = "'{$key}' => {$val}"; } diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index 544f614147d..c2147b08f2d 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -206,7 +206,7 @@ public function describe($model) { if ($c->type == 'character varying') { $length = null; $type = 'text'; - } else if ($c->type == 'uuid') { + } elseif ($c->type == 'uuid') { $length = 36; } else { $length = intval($c->oct_length); diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index 0150879f8ba..687b8e1e669 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -689,7 +689,7 @@ public function buildIndex($indexes, $table = null) { foreach ($indexes as $name => $value) { if ($name == 'PRIMARY') { $join[] = 'PRIMARY KEY (' . $this->name($value['column']) . ')'; - } else if (isset($value['unique']) && $value['unique']) { + } elseif (isset($value['unique']) && $value['unique']) { $out = "ALTER TABLE {$table} ADD CONSTRAINT {$name} UNIQUE"; if (is_array($value['column'])) { diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 877cea30d8c..870cbbfbb05 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -577,9 +577,9 @@ public function query() { } else { if (isset($args[1]) && $args[1] === true) { return $this->fetchAll($args[0], true); - } else if (isset($args[1]) && !is_array($args[1]) ) { + } elseif (isset($args[1]) && !is_array($args[1]) ) { return $this->fetchAll($args[0], false); - } else if (isset($args[1]) && is_array($args[1])) { + } elseif (isset($args[1]) && is_array($args[1])) { if (isset($args[2])) { $cache = $args[2]; } else { @@ -1733,7 +1733,7 @@ public function renderStatement($type, $data) { if (trim($indexes) !== '') { $columns .= ','; } - return "CREATE TABLE {$table} (\n{$columns}{$indexes}){$tableParameters};"; + return "CREATE TABLE {$table} (\n{$columns}{$indexes}) {$tableParameters};"; case 'alter': return; } diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 11011c87789..ea011248406 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -793,7 +793,7 @@ public function __isset($name) { $className = empty($this->__backAssociation[$type][$name]['className']) ? $name : $this->__backAssociation[$type][$name]['className']; break; - } else if ($type == 'hasAndBelongsToMany') { + } elseif ($type == 'hasAndBelongsToMany') { foreach ($this->{$type} as $k => $relation) { if (empty($relation['with'])) { continue; diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 06a3cbee91d..d5d0a328466 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -972,7 +972,7 @@ public function etag($tag = null, $weak = false) { protected function _getUTCDate($time = null) { if ($time instanceof DateTime) { $result = clone $time; - } else if (is_integer($time)) { + } elseif (is_integer($time)) { $result = new DateTime(date('Y-m-d H:i:s', $time)); } else { $result = new DateTime($time); diff --git a/lib/Cake/Network/Http/HttpSocket.php b/lib/Cake/Network/Http/HttpSocket.php index 0e0cdae751c..d71322d5bd0 100644 --- a/lib/Cake/Network/Http/HttpSocket.php +++ b/lib/Cake/Network/Http/HttpSocket.php @@ -403,7 +403,7 @@ public function request($request = array()) { $this->config['request']['cookies'][$Host] = array_merge($this->config['request']['cookies'][$Host], $this->response->cookies); } - if($this->request['redirect'] && $this->response->isRedirect()) { + if ($this->request['redirect'] && $this->response->isRedirect()) { $request['uri'] = $this->response->getHeader('Location'); $request['redirect'] = is_int($this->request['redirect']) ? $this->request['redirect'] - 1 : $this->request['redirect']; $this->response = $this->request($request); diff --git a/lib/Cake/Test/Case/Console/Command/ApiShellTest.php b/lib/Cake/Test/Case/Console/Command/ApiShellTest.php index a0ab4c4269b..54e0e075b22 100644 --- a/lib/Cake/Test/Case/Console/Command/ApiShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/ApiShellTest.php @@ -50,7 +50,7 @@ public function setUp() { * * @return void */ - public function testMethodNameDetection () { + public function testMethodNameDetection() { $this->Shell->expects($this->any())->method('in')->will($this->returnValue('q')); $this->Shell->expects($this->at(0))->method('out')->with('Controller'); diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index f278f78070e..167d457898c 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -482,7 +482,7 @@ public function testRevoke() { * @param bool $treesToo * @return void */ - protected function __debug ($printTreesToo = false) { + protected function __debug($printTreesToo = false) { $this->Acl->Aro->displayField = 'alias'; $this->Acl->Aco->displayField = 'alias'; $aros = $this->Acl->Aro->find('list', array('order' => 'lft')); diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index 3b25c60824e..fd00c655b44 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -599,7 +599,7 @@ public function testImportingHelpersFromAlternatePaths() { * * @return void */ - public function testFileLoading () { + public function testFileLoading() { $file = App::import('File', 'RealFile', false, array(), CAKE . 'Config' . DS . 'config.php'); $this->assertTrue($file); @@ -629,7 +629,7 @@ public function testFileLoadingWithArray() { * * @return void */ - public function testFileLoadingReturnValue () { + public function testFileLoadingReturnValue() { $file = App::import('File', 'Name', false, array(), CAKE . 'Config' . DS . 'config.php', true); $this->assertTrue(!empty($file)); @@ -648,7 +648,7 @@ public function testFileLoadingReturnValue () { * * @return void */ - public function testLoadingWithSearch () { + public function testLoadingWithSearch() { $file = App::import('File', 'NewName', false, array(CAKE . 'Config' . DS), 'config.php'); $this->assertTrue($file); diff --git a/lib/Cake/Test/Case/I18n/I18nTest.php b/lib/Cake/Test/Case/I18n/I18nTest.php index 772dda5ec79..9fd6512c559 100644 --- a/lib/Cake/Test/Case/I18n/I18nTest.php +++ b/lib/Cake/Test/Case/I18n/I18nTest.php @@ -2314,7 +2314,7 @@ public function testMoRulesFourteen() { * * @return void */ - public function testSetLanguageWithSession () { + public function testSetLanguageWithSession() { $_SESSION['Config']['language'] = 'po'; $singular = $this->__singular(); $this->assertEquals('Po (translated)', $singular); @@ -2354,7 +2354,7 @@ public function testSetLanguageWithSession () { * * @return void */ - public function testNoCoreTranslation () { + public function testNoCoreTranslation() { Configure::write('Config.language', 'po'); $singular = $this->__singular(); $this->assertEquals('Po (translated)', $singular); @@ -2439,7 +2439,7 @@ public function testPluginTranslation() { * * @return void */ - public function testPoMultipleLineTranslation () { + public function testPoMultipleLineTranslation() { Configure::write('Config.language', 'po'); $string = "This is a multiline translation\n"; @@ -2512,7 +2512,7 @@ public function testPoMultipleLineTranslation () { * * @return void */ - public function testPoNoTranslationNeeded () { + public function testPoNoTranslationNeeded() { Configure::write('Config.language', 'po'); $result = __('No Translation needed'); $this->assertEquals('No Translation needed', $result); @@ -2523,7 +2523,7 @@ public function testPoNoTranslationNeeded () { * * @return void */ - public function testPoQuotedString () { + public function testPoQuotedString() { Configure::write('Config.language', 'po'); $expected = 'this is a "quoted string" (translated)'; $this->assertEquals($expected, __('this is a "quoted string"')); diff --git a/lib/Cake/Test/Case/Model/models.php b/lib/Cake/Test/Case/Model/models.php index 9f583066efb..2eee6fd9741 100644 --- a/lib/Cake/Test/Case/Model/models.php +++ b/lib/Cake/Test/Case/Model/models.php @@ -183,7 +183,7 @@ class User extends CakeTestModel { * * @return bool */ - public function beforeFind ($queryData) { + public function beforeFind($queryData) { if (!empty($queryData['lazyLoad'])) { if (!isset($this->Article, $this->Comment, $this->ArticleFeatured)) { throw new Exception('Unavailable associations'); @@ -257,7 +257,7 @@ public function beforeSave($options = array()) { * @param mixed $title * @return void */ - static function titleDuplicate ($title) { + static function titleDuplicate($title) { if ($title === 'My Article Title') { return false; } diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index b38bd364dd1..57351dbcd15 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -20,7 +20,7 @@ if (!class_exists('AppController', false)) { require_once CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS . 'AppController.php'; -} elseif (!defined('APP_CONTROLLER_EXISTS')){ +} elseif (!defined('APP_CONTROLLER_EXISTS')) { define('APP_CONTROLLER_EXISTS', true); } diff --git a/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php b/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php index fe0999f1999..1d4a5afacfd 100644 --- a/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php @@ -228,7 +228,7 @@ public function testMultipleNoCacheTagsInViewfile() { * * @return void */ - public function testComplexNoCache () { + public function testComplexNoCache() { $this->Controller->cache_parsing(); $this->Controller->request->addParams(array( 'controller' => 'cache_test', diff --git a/lib/Cake/Test/test_app/View/Emails/html/default.ctp b/lib/Cake/Test/test_app/View/Emails/html/default.ctp index 8d94f13a97d..0f59cc2292e 100644 --- a/lib/Cake/Test/test_app/View/Emails/html/default.ctp +++ b/lib/Cake/Test/test_app/View/Emails/html/default.ctp @@ -19,7 +19,7 @@ ' . $line . '

'; endforeach; ?> \ No newline at end of file diff --git a/lib/Cake/TestSuite/CakeTestLoader.php b/lib/Cake/TestSuite/CakeTestLoader.php index 35d10daf0d9..bca88d4caaa 100644 --- a/lib/Cake/TestSuite/CakeTestLoader.php +++ b/lib/Cake/TestSuite/CakeTestLoader.php @@ -61,7 +61,7 @@ protected static function _basePath($params) { $result = null; if (!empty($params['core'])) { $result = CORE_TEST_CASES; - } else if (!empty($params['plugin'])) { + } elseif (!empty($params['plugin'])) { if (!CakePlugin::loaded($params['plugin'])) { try { CakePlugin::load($params['plugin']); diff --git a/lib/Cake/TestSuite/CakeTestSuiteCommand.php b/lib/Cake/TestSuite/CakeTestSuiteCommand.php index 7dd7e351d64..29953b5d20c 100644 --- a/lib/Cake/TestSuite/CakeTestSuiteCommand.php +++ b/lib/Cake/TestSuite/CakeTestSuiteCommand.php @@ -115,9 +115,7 @@ public function run(array $argv, $exit = true) { if ($exit) { if (isset($result) && $result->wasSuccessful()) { exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT); - } - - else if (!isset($result) || $result->errorCount() > 0) { + } elseif (!isset($result) || $result->errorCount() > 0) { exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); } diff --git a/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php b/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php index 18e54d8b4c2..a8e244a6bef 100644 --- a/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php +++ b/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php @@ -152,7 +152,7 @@ protected function _calculateCoveredLines($fileLines, $coverageData) { if (is_array($coverageData[$lineno]) && !empty($coverageData[$lineno])) { $covered++; $total++; - } else if ($coverageData[$lineno] === -1 || $coverageData[$lineno] === array()) { + } elseif ($coverageData[$lineno] === -1 || $coverageData[$lineno] === array()) { $total++; } } diff --git a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php index 9dc7efc5a93..d38cbc516ae 100644 --- a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php +++ b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php @@ -154,7 +154,7 @@ function coverage_show_hide(selector) { var element = document.getElementById(selector); element.style.display = (element.style.display == 'none') ? '' : 'none'; } - function coverage_toggle_all () { + function coverage_toggle_all() { var divs = document.querySelectorAll('div.coverage-container'); var i = divs.length; while (i--) { diff --git a/lib/Cake/Utility/File.php b/lib/Cake/Utility/File.php index 0827663c467..7b1b3a5001b 100644 --- a/lib/Cake/Utility/File.php +++ b/lib/Cake/Utility/File.php @@ -561,7 +561,7 @@ public function mime() { $finfo = finfo_open(FILEINFO_MIME); list($type, $charset) = explode(';', finfo_file($finfo, $this->pwd())); return $type; - } else if (function_exists('mime_content_type')) { + } elseif (function_exists('mime_content_type')) { return mime_content_type($this->pwd()); } return false; diff --git a/lib/Cake/Utility/Sanitize.php b/lib/Cake/Utility/Sanitize.php index a2f3ed9597c..c0b7130e47a 100644 --- a/lib/Cake/Utility/Sanitize.php +++ b/lib/Cake/Utility/Sanitize.php @@ -214,7 +214,7 @@ public static function clean($data, $options = array()) { if (is_string($options)) { $options = array('connection' => $options); - } else if (!is_array($options)) { + } elseif (!is_array($options)) { $options = array(); } diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php index a911a0b05e3..6633968c1e9 100644 --- a/lib/Cake/Utility/Set.php +++ b/lib/Cake/Utility/Set.php @@ -477,7 +477,7 @@ public static function extract($path, $data = null, $options = array()) { if (empty($tokens)) { break; } - } while(1); + } while (1); $r = array(); @@ -760,7 +760,7 @@ public static function check($data, $path = null) { * @param mixed $val1 First value * @param mixed $val2 Second value * @return array Returns the key => value pairs that are not common in $val1 and $val2 - * The expression for this function is ($val1 - $val2) + ($val2 - ($val1 - $val2)) + * The expression for this function is($val1 - $val2) + ($val2 - ($val1 - $val2)) * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::diff */ public static function diff($val1, $val2 = null) { @@ -963,7 +963,7 @@ public static function reverse($object) { $out = array(); if ($object instanceof SimpleXMLElement) { return Xml::toArray($object); - } else if (is_object($object)) { + } elseif (is_object($object)) { $keys = get_object_vars($object); if (isset($keys['_name_'])) { $identity = $keys['_name_']; @@ -1205,7 +1205,7 @@ public static function get($input, $path = null) { } $return = $input; - foreach($keys as $key) { + foreach ($keys as $key) { if (!isset($return[$key])) { return null; } diff --git a/lib/Cake/Utility/String.php b/lib/Cake/Utility/String.php index 94234a399f2..47ff74be1ec 100644 --- a/lib/Cake/Utility/String.php +++ b/lib/Cake/Utility/String.php @@ -81,7 +81,7 @@ public static function uuid() { if (function_exists('hphp_get_thread_id')) { $pid = hphp_get_thread_id(); - } else if (function_exists('zend_thread_id')) { + } elseif (function_exists('zend_thread_id')) { $pid = zend_thread_id(); } else { $pid = getmypid(); @@ -458,7 +458,7 @@ class_exists('Multibyte'); if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) { if (preg_match('/<[\w]+[^>]*>/s', $tag[0])) { array_unshift($openTags, $tag[2]); - } else if (preg_match('/<\/([\w]+)[^>]*>/s', $tag[0], $closeTag)) { + } elseif (preg_match('/<\/([\w]+)[^>]*>/s', $tag[0], $closeTag)) { $pos = array_search($closeTag[1], $openTags); if ($pos !== false) { array_splice($openTags, $pos, 1); diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index ad7817b0e17..8e7ef063ba9 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -2523,7 +2523,7 @@ protected function _generateOptions($name, $options = array()) { $data['10'] = __d('cake', 'October'); $data['11'] = __d('cake', 'November'); $data['12'] = __d('cake', 'December'); - } else if (is_array($options['monthNames'])) { + } elseif (is_array($options['monthNames'])) { $data = $options['monthNames']; } else { for ($m = 1; $m <= 12; $m++) { diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index 7f18b24e0a1..7b0d9eb3824 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -1136,7 +1136,7 @@ protected function _nestedListItem($items, $options, $itemOptions, $tag) { } if (isset($itemOptions['even']) && $index % 2 == 0) { $itemOptions['class'] = $itemOptions['even']; - } else if (isset($itemOptions['odd']) && $index % 2 != 0) { + } elseif (isset($itemOptions['odd']) && $index % 2 != 0) { $itemOptions['class'] = $itemOptions['odd']; } $out .= sprintf($this->_tags['li'], $this->_parseAttributes($itemOptions, array('even', 'odd'), ' ', ''), $item); diff --git a/lib/Cake/View/Helper/RssHelper.php b/lib/Cake/View/Helper/RssHelper.php index 3c29993e801..f7c7a305d4f 100644 --- a/lib/Cake/View/Helper/RssHelper.php +++ b/lib/Cake/View/Helper/RssHelper.php @@ -220,7 +220,7 @@ public function item($att = array(), $elements = array()) { } $elements[$key] = implode('', $categories); continue 2; - } else if (is_array($val) && isset($val['domain'])) { + } elseif (is_array($val) && isset($val['domain'])) { $attrib['domain'] = $val['domain']; } break; diff --git a/lib/Cake/View/MediaView.php b/lib/Cake/View/MediaView.php index 822e2beb852..7248b940b33 100644 --- a/lib/Cake/View/MediaView.php +++ b/lib/Cake/View/MediaView.php @@ -41,7 +41,7 @@ * * {{{ * class ExampleController extends AppController { - * public function download () { + * public function download() { * $this->viewClass = 'Media'; * $params = array( * 'id' => 'example.zip', @@ -142,7 +142,7 @@ public function render($view = null, $layout = null) { if (preg_match('%Opera(/| )([0-9].[0-9]{1,2})%', $agent)) { $contentType = 'application/octetstream'; - } else if (preg_match('/MSIE ([0-9].[0-9]{1,2})/', $agent)) { + } elseif (preg_match('/MSIE ([0-9].[0-9]{1,2})/', $agent)) { $contentType = 'application/force-download'; } diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index 741f9f95a67..1e978ed24bb 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -952,7 +952,7 @@ protected function _getViewFileName($name = null) { return $name; } $name = trim($name, DS); - } else if ($name[0] === '.') { + } elseif ($name[0] === '.') { $name = substr($name, 3); } elseif (!$plugin) { $name = $this->viewPath . DS . $subDir . $name;