Skip to content
Permalink
Browse files

== to === and != to !== where applicable

  • Loading branch information...
dereuromark committed Feb 12, 2013
1 parent ee4a116 commit 111366d5c856e5cb27b60c50c11f6deb69344570
Showing with 291 additions and 291 deletions.
  1. +2 −2 lib/Cake/Cache/Engine/MemcacheEngine.php
  2. +1 −1 lib/Cake/Configure/IniReader.php
  3. +3 −3 lib/Cake/Console/Command/AclShell.php
  4. +10 −10 lib/Cake/Console/Command/Task/ControllerTask.php
  5. +9 −9 lib/Cake/Console/Command/Task/DbConfigTask.php
  6. +10 −10 lib/Cake/Console/Command/Task/ExtractTask.php
  7. +7 −7 lib/Cake/Console/Command/Task/FixtureTask.php
  8. +27 −27 lib/Cake/Console/Command/Task/ModelTask.php
  9. +1 −1 lib/Cake/Console/Command/Task/PluginTask.php
  10. +13 −13 lib/Cake/Console/Command/Task/TestTask.php
  11. +6 −6 lib/Cake/Console/Command/Task/ViewTask.php
  12. +1 −1 lib/Cake/Console/Command/TestShell.php
  13. +3 −3 lib/Cake/Console/Command/TestsuiteShell.php
  14. +4 −4 lib/Cake/Console/ConsoleOptionParser.php
  15. +1 −1 lib/Cake/Console/ConsoleOutput.php
  16. +5 −5 lib/Cake/Console/Shell.php
  17. +2 −2 lib/Cake/Console/ShellDispatcher.php
  18. +1 −1 lib/Cake/Console/Templates/default/classes/model.ctp
  19. +1 −1 lib/Cake/Console/Templates/skel/webroot/index.php
  20. +1 −1 lib/Cake/Controller/Component/Auth/ControllerAuthorize.php
  21. +2 −2 lib/Cake/Controller/Component/Auth/DigestAuthenticate.php
  22. +2 −2 lib/Cake/Controller/Component/RequestHandlerComponent.php
  23. +3 −3 lib/Cake/Controller/Controller.php
  24. +3 −3 lib/Cake/Controller/Scaffold.php
  25. +4 −4 lib/Cake/Core/App.php
  26. +1 −1 lib/Cake/Error/ErrorHandler.php
  27. +2 −2 lib/Cake/Error/ExceptionRenderer.php
  28. +2 −2 lib/Cake/I18n/I18n.php
  29. +1 −1 lib/Cake/I18n/Multibyte.php
  30. +1 −1 lib/Cake/Log/Engine/ConsoleLog.php
  31. +1 −1 lib/Cake/Log/Engine/FileLog.php
  32. +4 −4 lib/Cake/Model/Behavior/ContainableBehavior.php
  33. +1 −1 lib/Cake/Model/BehaviorCollection.php
  34. +5 −5 lib/Cake/Model/CakeSchema.php
  35. +14 −14 lib/Cake/Model/Datasource/Database/Postgres.php
  36. +3 −3 lib/Cake/Model/Datasource/Database/Sqlite.php
  37. +10 −10 lib/Cake/Model/Datasource/Database/Sqlserver.php
  38. +4 −4 lib/Cake/Model/Datasource/DboSource.php
  39. +5 −5 lib/Cake/Model/Model.php
  40. +2 −2 lib/Cake/Model/Permission.php
  41. +1 −1 lib/Cake/Model/Validator/CakeValidationRule.php
  42. +5 −5 lib/Cake/Network/CakeRequest.php
  43. +1 −1 lib/Cake/Network/CakeSocket.php
  44. +1 −1 lib/Cake/Network/Email/CakeEmail.php
  45. +3 −3 lib/Cake/Network/Http/HttpSocket.php
  46. +4 −4 lib/Cake/Routing/Router.php
  47. +2 −2 lib/Cake/Test/Case/BasicsTest.php
  48. +1 −1 lib/Cake/Test/Case/Cache/CacheTest.php
  49. +2 −2 lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php
  50. +3 −3 lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php
  51. +1 −1 lib/Cake/Test/Case/Controller/ControllerTest.php
  52. +1 −1 lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php
  53. +2 −2 lib/Cake/Test/Case/Model/AclNodeTest.php
  54. +9 −9 lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
  55. +1 −1 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
  56. +1 −1 lib/Cake/Test/Case/Model/models.php
  57. +1 −1 lib/Cake/Test/Case/Network/CakeRequestTest.php
  58. +2 −2 lib/Cake/Test/Case/Routing/DispatcherTest.php
  59. +1 −1 lib/Cake/Test/Case/Routing/RouterTest.php
  60. +1 −1 lib/Cake/Test/Case/Utility/FileTest.php
  61. +1 −1 lib/Cake/Test/test_app/Lib/Cache/Engine/TestAppCacheEngine.php
  62. +2 −2 lib/Cake/TestSuite/CakeTestCase.php
  63. +3 −3 lib/Cake/TestSuite/ControllerTestCase.php
  64. +3 −3 lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
  65. +3 −3 lib/Cake/Utility/CakeNumber.php
  66. +5 −5 lib/Cake/Utility/CakeTime.php
  67. +5 −5 lib/Cake/Utility/Debugger.php
  68. +1 −1 lib/Cake/Utility/File.php
  69. +3 −3 lib/Cake/Utility/Folder.php
  70. +1 −1 lib/Cake/Utility/Hash.php
  71. +1 −1 lib/Cake/Utility/Inflector.php
  72. +2 −2 lib/Cake/Utility/Security.php
  73. +1 −1 lib/Cake/Utility/String.php
  74. +2 −2 lib/Cake/Utility/Validation.php
  75. +1 −1 lib/Cake/View/Elements/exception_stack_trace.ctp
  76. +1 −1 lib/Cake/View/Helper.php
  77. +1 −1 lib/Cake/View/Helper/CacheHelper.php
  78. +11 −11 lib/Cake/View/Helper/FormHelper.php
  79. +1 −1 lib/Cake/View/Helper/HtmlHelper.php
  80. +2 −2 lib/Cake/View/Helper/JqueryEngineHelper.php
  81. +4 −4 lib/Cake/View/Helper/MootoolsEngineHelper.php
  82. +3 −3 lib/Cake/View/Helper/PaginatorHelper.php
  83. +6 −6 lib/Cake/View/Helper/PrototypeEngineHelper.php
  84. +1 −1 lib/Cake/View/Helper/RssHelper.php
  85. +1 −1 lib/Cake/View/Helper/SessionHelper.php
  86. +1 −1 lib/Cake/View/ScaffoldView.php
  87. +1 −1 lib/Cake/View/Scaffolds/form.ctp
  88. +1 −1 lib/Cake/View/View.php
  89. +2 −2 lib/Cake/basics.php
@@ -106,10 +106,10 @@ public function init($settings = array()) {
* @return array Array containing host, port
*/
protected function _parseServerString($server) {
if ($server[0] == 'u') {
if ($server[0] === 'u') {
return array($server, 0);
}
if (substr($server, 0, 1) == '[') {
if (substr($server, 0, 1) === '[') {
$position = strpos($server, ']:');
if ($position !== false) {
$position++;
@@ -160,7 +160,7 @@ public function dump($key, $data) {
$result = array();
foreach ($data as $k => $value) {
$isSection = false;
if ($k[0] != '[') {
if ($k[0] !== '[') {
$result[] = "[$k]";
$isSection = true;
}
@@ -122,14 +122,14 @@ public function create() {
$class = ucfirst($this->args[0]);
$parent = $this->parseIdentifier($this->args[1]);
if (!empty($parent) && $parent != '/' && $parent != 'root') {
if (!empty($parent) && $parent !== '/' && $parent !== 'root') {
$parent = $this->_getNodeId($class, $parent);
} else {
$parent = null;
}
$data = $this->parseIdentifier($this->args[2]);
if (is_string($data) && $data != '/') {
if (is_string($data) && $data !== '/') {
$data = array('alias' => $data);
} elseif (is_string($data)) {
$this->error(__d('cake_console', '/ can not be used as an alias!') . __d('cake_console', " / is the root, please supply a sub alias"));
@@ -604,7 +604,7 @@ protected function _dataVars($type = null) {
}
$vars = array();
$class = ucwords($type);
$vars['secondary_id'] = (strtolower($class) == 'aro') ? 'foreign_key' : 'object_id';
$vars['secondary_id'] = (strtolower($class) === 'aro') ? 'foreign_key' : 'object_id';
$vars['data_name'] = $type;
$vars['table_name'] = $type . 's';
$vars['class'] = $class;
@@ -66,7 +66,7 @@ public function execute() {
if (!isset($this->connection)) {
$this->connection = 'default';
}
if (strtolower($this->args[0]) == 'all') {
if (strtolower($this->args[0]) === 'all') {
return $this->all();
}
@@ -162,13 +162,13 @@ protected function _interactive() {
}
$doItInteractive = $this->in(implode("\n", $question), array('y', 'n'), 'y');
if (strtolower($doItInteractive) == 'y') {
if (strtolower($doItInteractive) === 'y') {
$this->interactive = true;
$useDynamicScaffold = $this->in(
__d('cake_console', "Would you like to use dynamic scaffolding?"), array('y', 'n'), 'n'
);
if (strtolower($useDynamicScaffold) == 'y') {
if (strtolower($useDynamicScaffold) === 'y') {
$wannaBakeCrud = 'n';
$actions = 'scaffold';
} else {
@@ -185,20 +185,20 @@ protected function _interactive() {
list($wannaBakeCrud, $wannaBakeAdminCrud) = $this->_askAboutMethods();
}
if (strtolower($wannaBakeCrud) == 'y') {
$actions = $this->bakeActions($controllerName, null, strtolower($wannaUseSession) == 'y');
if (strtolower($wannaBakeCrud) === 'y') {
$actions = $this->bakeActions($controllerName, null, strtolower($wannaUseSession) === 'y');
}
if (strtolower($wannaBakeAdminCrud) == 'y') {
if (strtolower($wannaBakeAdminCrud) === 'y') {
$admin = $this->Project->getPrefix();
$actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) == 'y');
$actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) === 'y');
}
$baked = false;
if ($this->interactive === true) {
$this->confirmController($controllerName, $useDynamicScaffold, $helpers, $components);
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y','n'), 'y');
if (strtolower($looksGood) == 'y') {
if (strtolower($looksGood) === 'y') {
$baked = $this->bake($controllerName, $actions, $helpers, $components);
if ($baked && $this->_checkUnitTest()) {
$this->bakeTest($controllerName);
@@ -229,7 +229,7 @@ public function confirmController($controllerName, $useDynamicScaffold, $helpers
$this->hr();
$this->out(__d('cake_console', "Controller Name:\n\t%s", $controllerName));
if (strtolower($useDynamicScaffold) == 'y') {
if (strtolower($useDynamicScaffold) === 'y') {
$this->out("public \$scaffold;");
}
@@ -386,7 +386,7 @@ public function doComponents() {
protected function _doPropertyChoices($prompt, $example) {
$proceed = $this->in($prompt, array('y','n'), 'n');
$property = array();
if (strtolower($proceed) == 'y') {
if (strtolower($proceed) === 'y') {
$propertyList = $this->in($example);
$propertyListTrimmed = str_replace(' ', '', $propertyList);
$property = explode(',', $propertyListTrimmed);
@@ -110,7 +110,7 @@ protected function _interactive() {
$datasource = $this->in(__d('cake_console', 'Datasource:'), array('Mysql', 'Postgres', 'Sqlite', 'Sqlserver'), 'Mysql');
$persistent = $this->in(__d('cake_console', 'Persistent Connection?'), array('y', 'n'), 'n');
if (strtolower($persistent) == 'n') {
if (strtolower($persistent) === 'n') {
$persistent = 'false';
} else {
$persistent = 'true';
@@ -126,7 +126,7 @@ protected function _interactive() {
$port = $this->in(__d('cake_console', 'Port?'), null, 'n');
}
if (strtolower($port) == 'n') {
if (strtolower($port) === 'n') {
$port = null;
}
@@ -142,7 +142,7 @@ protected function _interactive() {
if (!$password) {
$blank = $this->in(__d('cake_console', 'The password you supplied was empty. Use an empty password?'), array('y', 'n'), 'n');
if ($blank == 'y') {
if ($blank === 'y') {
$blankPassword = true;
}
}
@@ -157,25 +157,25 @@ protected function _interactive() {
while (!$prefix) {
$prefix = $this->in(__d('cake_console', 'Table Prefix?'), null, 'n');
}
if (strtolower($prefix) == 'n') {
if (strtolower($prefix) === 'n') {
$prefix = null;
}
$encoding = '';
while (!$encoding) {
$encoding = $this->in(__d('cake_console', 'Table encoding?'), null, 'n');
}
if (strtolower($encoding) == 'n') {
if (strtolower($encoding) === 'n') {
$encoding = null;
}
$schema = '';
if ($datasource == 'postgres') {
if ($datasource === 'postgres') {
while (!$schema) {
$schema = $this->in(__d('cake_console', 'Table schema?'), null, 'n');
}
}
if (strtolower($schema) == 'n') {
if (strtolower($schema) === 'n') {
$schema = null;
}
@@ -188,7 +188,7 @@ protected function _interactive() {
$dbConfigs[] = $config;
$doneYet = $this->in(__d('cake_console', 'Do you wish to add another database configuration?'), null, 'n');
if (strtolower($doneYet == 'n')) {
if (strtolower($doneYet === 'n')) {
$done = true;
}
}
@@ -239,7 +239,7 @@ protected function _verify($config) {
$this->hr();
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y');
if (strtolower($looksGood) == 'y') {
if (strtolower($looksGood) === 'y') {
return $config;
}
return false;
@@ -388,14 +388,14 @@ protected function _parse($functionName, $map) {
}
list($type, $string, $line) = $countToken;
if (($type == T_STRING) && ($string == $functionName) && ($firstParenthesis == '(')) {
if (($type == T_STRING) && ($string == $functionName) && ($firstParenthesis === '(')) {
$position = $count;
$depth = 0;
while (!$depth) {
if ($this->_tokens[$position] == '(') {
if ($this->_tokens[$position] === '(') {
$depth++;
} elseif ($this->_tokens[$position] == ')') {
} elseif ($this->_tokens[$position] === ')') {
$depth--;
}
$position++;
@@ -537,7 +537,7 @@ protected function _buildFiles() {
}
$this->_store($domain, $header, $sentence);
if ($domain != 'default' && $this->_merge) {
if ($domain !== 'default' && $this->_merge) {
$this->_store('default', $header, $sentence);
}
}
@@ -640,11 +640,11 @@ protected function _writeHeader() {
protected function _getStrings(&$position, $target) {
$strings = array();
$count = count($strings);
while ($count < $target && ($this->_tokens[$position] == ',' || $this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING)) {
while ($count < $target && ($this->_tokens[$position] === ',' || $this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING)) {
$count = count($strings);
if ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING && $this->_tokens[$position + 1] == '.') {
if ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING && $this->_tokens[$position + 1] === '.') {
$string = '';
while ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING || $this->_tokens[$position] == '.') {
while ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING || $this->_tokens[$position] === '.') {
if ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING) {
$string .= $this->_formatString($this->_tokens[$position][1]);
}
@@ -668,7 +668,7 @@ protected function _getStrings(&$position, $target) {
protected function _formatString($string) {
$quote = substr($string, 0, 1);
$string = substr($string, 1, -1);
if ($quote == '"') {
if ($quote === '"') {
$string = stripcslashes($string);
} else {
$string = strtr($string, array("\\'" => "'", "\\\\" => "\\"));
@@ -697,11 +697,11 @@ protected function _markerError($file, $line, $marker, $count) {
$this->out($this->_tokens[$count][1], false);
} else {
$this->out($this->_tokens[$count], false);
if ($this->_tokens[$count] == '(') {
if ($this->_tokens[$count] === '(') {
$parenthesis++;
}
if ($this->_tokens[$count] == ')') {
if ($this->_tokens[$count] === ')') {
$parenthesis--;
}
}
@@ -107,7 +107,7 @@ public function execute() {
if (!isset($this->connection)) {
$this->connection = 'default';
}
if (strtolower($this->args[0]) == 'all') {
if (strtolower($this->args[0]) === 'all') {
return $this->all();
}
$model = $this->_modelName($this->args[0]);
@@ -159,17 +159,17 @@ protected function _interactive() {
public function importOptions($modelName) {
$options = array();
$doSchema = $this->in(__d('cake_console', 'Would you like to import schema for this fixture?'), array('y', 'n'), 'n');
if ($doSchema == 'y') {
if ($doSchema === 'y') {
$options['schema'] = $modelName;
}
$doRecords = $this->in(__d('cake_console', 'Would you like to use record importing for this fixture?'), array('y', 'n'), 'n');
if ($doRecords == 'y') {
if ($doRecords === 'y') {
$options['records'] = true;
}
if ($doRecords == 'n') {
if ($doRecords === 'n') {
$prompt = __d('cake_console', "Would you like to build this fixture with data from %s's table?", $modelName);
$fromTable = $this->in($prompt, array('y', 'n'), 'n');
if (strtolower($fromTable) == 'y') {
if (strtolower($fromTable) === 'y') {
$options['fromTable'] = true;
}
}
@@ -203,7 +203,7 @@ public function bake($model, $useTable = false, $importOptions = array()) {
if (isset($importOptions['records'])) {
$importBits[] = "'records' => true";
}
if ($this->connection != 'default') {
if ($this->connection !== 'default') {
$importBits[] .= "'connection' => '{$this->connection}'";
}
if (!empty($importBits)) {
@@ -307,7 +307,7 @@ protected function _generateRecords($tableInfo, $recordCount = 1) {
case 'string':
case 'binary':
$isPrimaryUuid = (
isset($fieldInfo['key']) && strtolower($fieldInfo['key']) == 'primary' &&
isset($fieldInfo['key']) && strtolower($fieldInfo['key']) === 'primary' &&
isset($fieldInfo['length']) && $fieldInfo['length'] == 36
);
if ($isPrimaryUuid) {
Oops, something went wrong.

0 comments on commit 111366d

Please sign in to comment.
You can’t perform that action at this time.