Selaa lähdekoodia

[DoctrineBridge] fixed CS

Fabien Potencier 13 vuotta sitten
vanhempi
commit
3976b7a5ee

+ 2 - 2
src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

@@ -81,14 +81,14 @@ class EntityUserProvider implements UserProviderInterface
         // might have changed without proper persistence in the database.
         // might have changed without proper persistence in the database.
         // That's the case when the user has been changed by a form with
         // That's the case when the user has been changed by a form with
         // validation errors.
         // validation errors.
-        $id = $this->metadata->getIdentifierValues($user);
-        if (!$id) {
+        if (!$id = $this->metadata->getIdentifierValues($user)) {
             throw new \InvalidArgumentException("You cannot refresh a user ".
             throw new \InvalidArgumentException("You cannot refresh a user ".
                 "from the EntityUserProvider that does not contain an identifier. ".
                 "from the EntityUserProvider that does not contain an identifier. ".
                 "The user object has to be serialized with its own identifier " .
                 "The user object has to be serialized with its own identifier " .
                 "mapped by Doctrine."
                 "mapped by Doctrine."
             );
             );
         }
         }
+
         return $this->repository->find($id);
         return $this->repository->find($id);
     }
     }