diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php index e87abedc3..94c2bb443 100644 --- a/lib/Cake/Model/Behavior/TreeBehavior.php +++ b/lib/Cake/Model/Behavior/TreeBehavior.php @@ -682,7 +682,7 @@ class TreeBehavior extends ModelBehavior { $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), @@ -713,7 +713,7 @@ class TreeBehavior extends ModelBehavior { $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) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 670b71a6d..3b9563441 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -1849,7 +1849,7 @@ class Model extends Object implements CakeEventListener { } 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) { diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index f6a0ed2e5..2f60667fe 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -570,7 +570,7 @@ class CakeResponse { 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); diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php index 375e08d3f..b91a6d5a6 100644 --- a/lib/Cake/Routing/Router.php +++ b/lib/Cake/Routing/Router.php @@ -1038,7 +1038,7 @@ class Router { } $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; }