Permalink
Browse files

Strict checks where applicable.

  • Loading branch information...
1 parent 02acf63 commit eb852a02476a3cde5a9e5b64385c95015e732f6b @dereuromark dereuromark committed Oct 8, 2013
@@ -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),
@@ -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)
View
@@ -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) {
@@ -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);
@@ -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;
}

0 comments on commit eb852a0

Please sign in to comment.