From: Alangi Derick Date: Wed, 31 Oct 2018 12:22:58 +0000 (+0100) Subject: Use identical check instead of equality check X-Git-Tag: 1.34.0-rc.0~3602 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=e907d4328dc3e1958e16e09e93c835a25bec3d2a;p=lhc%2Fweb%2Fwiklou.git Use identical check instead of equality check $user->getId() returns an int and it's strict on this, so the check here should be an identical check as "==" does unnecessary coercion. So "===" will be faster and improves on speed/performance. Change-Id: I28a4e86ab339f10251df8846b8d951b673fe4f9e --- diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index c2e6d32523..aae5a83a22 100644 --- a/includes/auth/AuthManager.php +++ b/includes/auth/AuthManager.php @@ -1224,7 +1224,7 @@ class AuthManager implements LoggerAwareInterface { return $ret; } } else { - if ( $user->getId() == 0 ) { + if ( $user->getId() === 0 ) { $this->logger->debug( __METHOD__ . ': User does not exist locally when it should', [ 'user' => $user->getName(), 'creator' => $creator->getName(),