Skip to content

Commit

Permalink
Strict checks where applicable.
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Oct 8, 2013
1 parent 02acf63 commit eb852a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Model/Behavior/TreeBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ protected function _recoverByParentId(Model $Model, $counter = 1, $parentId = nu
$children = $Model->find('all', $params);
$hasChildren = (bool)$children;

if (!is_null($parentId)) {
if ($parentId !== null) {
if ($hasChildren) {
$Model->updateAll(
array($this->settings[$Model->alias]['left'] => $counter),
Expand Down Expand Up @@ -713,7 +713,7 @@ protected function _recoverByParentId(Model $Model, $counter = 1, $parentId = nu
$children = $Model->find('all', $params);
}

if (!is_null($parentId) && $hasChildren) {
if ($parentId !== null && $hasChildren) {
$Model->updateAll(
array($this->settings[$Model->alias]['right'] => $counter),
array($Model->escapeField() => $parentId)
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,7 @@ protected function _saveMulti($joined, $id, $db) {
}

foreach ((array)$data as $row) {
if ((is_string($row) && (strlen($row) == 36 || strlen($row) == 16)) || is_numeric($row)) {
if ((is_string($row) && (strlen($row) === 36 || strlen($row) === 16)) || is_numeric($row)) {
$newJoins[] = $row;
$values = array($id, $row);
if ($isUUID && $primaryAdded) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Network/CakeResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ public function header($header = null, $value = null) {
if (is_numeric($header)) {
list($header, $value) = array($value, null);
}
if (is_null($value)) {
if ($value === null) {
list($header, $value) = explode(':', $header, 2);
}
$this->_headers[$header] = is_array($value) ? array_map('trim', $value) : trim($value);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ public static function queryString($q, $extra = array(), $escape = false) {
}
$addition = http_build_query($q, null, $join);

if ($out && $addition && substr($out, strlen($join) * -1, strlen($join)) != $join) {
if ($out && $addition && substr($out, strlen($join) * -1, strlen($join)) !== $join) {
$out .= $join;
}

Expand Down

0 comments on commit eb852a0

Please sign in to comment.