mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Strict checks where applicable.
This commit is contained in:
parent
02acf636a7
commit
eb852a0247
4 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue