Use identical check instead of equality check
authorAlangi Derick <alangiderick@gmail.com>
Wed, 31 Oct 2018 12:22:58 +0000 (13:22 +0100)
committerAlangi Derick <alangiderick@gmail.com>
Wed, 31 Oct 2018 12:22:58 +0000 (13:22 +0100)
$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

includes/auth/AuthManager.php

index c2e6d32..aae5a83 100644 (file)
@@ -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(),