diff --git a/.travis.yml b/.travis.yml index 507135c11..a84bb5115 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,8 @@ matrix: - PHPCS=1 before_script: + - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then composer global require 'phpunit/phpunit=3.7.33'; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then ln -s ~/.composer/vendor/phpunit/phpunit/PHPUnit ./vendors/PHPUnit; fi" - sudo locale-gen de_DE - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi" diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php index 917015a9f..8134a638e 100644 --- a/lib/Cake/Console/Command/ConsoleShell.php +++ b/lib/Cake/Console/Command/ConsoleShell.php @@ -303,7 +303,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 ae46f6ef8..4c03fb9c3 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 75c0c13b6..737d2cec7 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 d60bc0e5c..a50803868 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -414,7 +414,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 128674b5b..9f7935e7c 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -632,13 +632,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 f85d57cd0..78afac367 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 8fc387aba..7f94de83f 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 27d7561fe..3a05fef7d 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -609,7 +609,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; ?> - +