From 7a287a694263f65fd9719695980d4628f484c6f2 Mon Sep 17 00:00:00 2001 From: euromark Date: Tue, 29 Apr 2014 14:19:33 +0200 Subject: [PATCH] More coding standard corrections. --- lib/Cake/Console/Command/ConsoleShell.php | 2 +- lib/Cake/Console/Command/ServerShell.php | 2 +- lib/Cake/Console/Command/Task/DbConfigTask.php | 2 +- lib/Cake/Console/Command/Task/ExtractTask.php | 2 +- lib/Cake/Console/Command/Task/ModelTask.php | 4 ++-- lib/Cake/Console/Command/Task/TestTask.php | 2 +- lib/Cake/Console/Command/Task/ViewTask.php | 2 +- lib/Cake/Console/Command/UpgradeShell.php | 2 +- lib/Cake/Console/ConsoleInput.php | 2 +- lib/Cake/Console/Templates/default/views/form.ctp | 2 +- lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp | 2 +- lib/Cake/Controller/Component/Acl/PhpAcl.php | 4 ++-- lib/Cake/Controller/Component/AuthComponent.php | 2 +- lib/Cake/Controller/Component/PaginatorComponent.php | 2 +- lib/Cake/Controller/Component/RequestHandlerComponent.php | 2 +- lib/Cake/Controller/Component/SecurityComponent.php | 8 ++++---- lib/Cake/Core/App.php | 2 +- lib/Cake/Log/Engine/FileLog.php | 2 +- lib/Cake/Model/Behavior/ContainableBehavior.php | 4 ++-- lib/Cake/Model/Behavior/TranslateBehavior.php | 2 +- lib/Cake/Model/Behavior/TreeBehavior.php | 5 +++-- lib/Cake/Model/BehaviorCollection.php | 2 +- lib/Cake/Model/CakeSchema.php | 4 ++-- lib/Cake/Model/Datasource/Database/Mysql.php | 4 ++-- lib/Cake/Model/Datasource/Database/Postgres.php | 6 +++--- lib/Cake/Model/Datasource/Database/Sqlserver.php | 2 +- lib/Cake/Model/Datasource/DboSource.php | 8 ++++---- lib/Cake/Model/Model.php | 6 +++--- lib/Cake/Network/CakeRequest.php | 2 +- lib/Cake/Network/CakeResponse.php | 2 +- lib/Cake/Routing/Filter/AssetDispatcher.php | 2 +- lib/Cake/Test/Case/BasicsTest.php | 2 +- lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php | 2 +- .../Test/Case/Model/Datasource/Database/MysqlTest.php | 4 ++-- lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php | 4 ++-- lib/Cake/Test/Case/Utility/DebuggerTest.php | 4 ++-- lib/Cake/Utility/CakeTime.php | 2 +- lib/Cake/Utility/Folder.php | 4 ++-- lib/Cake/View/Helper/FormHelper.php | 2 +- lib/Cake/View/Helper/HtmlHelper.php | 2 +- 40 files changed, 61 insertions(+), 60 deletions(-) diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php index 177b13353..d90c26161 100644 --- a/lib/Cake/Console/Command/ConsoleShell.php +++ b/lib/Cake/Console/Command/ConsoleShell.php @@ -304,7 +304,7 @@ class ConsoleShell extends AppShell { $validCurrentAssociation = false; foreach ($currentAssociations as $model => $currentAssociation) { - if ($model == $modelB && $association == $currentAssociation) { + if ($model === $modelB && $association === $currentAssociation) { $validCurrentAssociation = true; } } diff --git a/lib/Cake/Console/Command/ServerShell.php b/lib/Cake/Console/Command/ServerShell.php index 7247973c0..14228d316 100644 --- a/lib/Cake/Console/Command/ServerShell.php +++ b/lib/Cake/Console/Command/ServerShell.php @@ -92,7 +92,7 @@ class ServerShell extends AppShell { } // for windows - if (substr($this->_documentRoot, -1, 1) == DIRECTORY_SEPARATOR) { + if (substr($this->_documentRoot, -1, 1) === DIRECTORY_SEPARATOR) { $this->_documentRoot = substr($this->_documentRoot, 0, strlen($this->_documentRoot) - 1); } if (preg_match("/^([a-z]:)[\\\]+(.+)$/i", $this->_documentRoot, $m)) { diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php index 7e61b568b..46af32646 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -296,7 +296,7 @@ class DbConfigTask extends AppShell { foreach ($oldConfigs as $key => $oldConfig) { foreach ($configs as $config) { - if ($oldConfig['name'] == $config['name']) { + if ($oldConfig['name'] === $config['name']) { unset($oldConfigs[$key]); } } diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index 8180570b5..33d1c04c7 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -411,7 +411,7 @@ class ExtractTask extends AppShell { $mapCount = count($map); $strings = $this->_getStrings($position, $mapCount); - if ($mapCount == count($strings)) { + if ($mapCount === count($strings)) { extract(array_combine($map, $strings)); $category = isset($category) ? $category : 6; $category = intval($category); diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 67d2cd78d..6b517c0e8 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -611,13 +611,13 @@ class ModelTask extends BakeTask { } foreach ($tempFieldNames as $fieldName) { $assoc = false; - if ($fieldName != $model->primaryKey && $fieldName == $foreignKey) { + if ($fieldName !== $model->primaryKey && $fieldName === $foreignKey) { $assoc = array( 'alias' => $tempOtherModel->name, 'className' => $tempOtherModel->name, 'foreignKey' => $fieldName ); - } elseif ($otherTable == $model->table && $fieldName === 'parent_id') { + } elseif ($otherTable === $model->table && $fieldName === 'parent_id') { $assoc = array( 'alias' => 'Child' . $model->name, 'className' => $model->name, diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index a2f723e64..6efa98f65 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -302,7 +302,7 @@ class TestTask extends BakeTask { $position = strpos($class, $type); - if ($position !== false && strlen($class) - $position == strlen($type)) { + if ($position !== false && (strlen($class) - $position) === strlen($type)) { return $class; } return $class . $type; diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index 4a84d87d7..043610ad5 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -151,7 +151,7 @@ class ViewTask extends BakeTask { unset($methods[$i]); } } - if ($method[0] === '_' || $method == strtolower($this->controllerName . 'Controller')) { + if ($method[0] === '_' || $method === strtolower($this->controllerName . 'Controller')) { unset($methods[$i]); } } diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php index 0169b53a0..51a39043c 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -581,7 +581,7 @@ class UpgradeShell extends AppShell { $new = 'View' . DS . Inflector::camelize($old); $old = 'View' . DS . $old; - if ($new == $old) { + if ($new === $old) { continue; } diff --git a/lib/Cake/Console/ConsoleInput.php b/lib/Cake/Console/ConsoleInput.php index e8af58bb0..ee2639ffd 100644 --- a/lib/Cake/Console/ConsoleInput.php +++ b/lib/Cake/Console/ConsoleInput.php @@ -47,7 +47,7 @@ class ConsoleInput { * @param string $handle The location of the stream to use as input. */ public function __construct($handle = 'php://stdin') { - $this->_canReadline = extension_loaded('readline') && $handle == 'php://stdin' ? true : false; + $this->_canReadline = extension_loaded('readline') && $handle === 'php://stdin' ? true : false; $this->_input = fopen($handle, 'r'); } diff --git a/lib/Cake/Console/Templates/default/views/form.ctp b/lib/Cake/Console/Templates/default/views/form.ctp index fa9c58315..c7cbc7b77 100644 --- a/lib/Cake/Console/Templates/default/views/form.ctp +++ b/lib/Cake/Console/Templates/default/views/form.ctp @@ -23,7 +23,7 @@ Form->input('{$field}');\n"; diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp index 020f32d12..35e09583c 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp @@ -13,7 +13,7 @@ Html->charset(); ?> <?php echo $page_title; ?> - +