mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Applied symplify rules to codebase.
This commit is contained in:
parent
2f20d90041
commit
388e847b17
136 changed files with 1370 additions and 789 deletions
|
@ -35,7 +35,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
|||
* @method User[] findAll()
|
||||
* @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class UserRepository extends NamedDBElementRepository implements PasswordUpgraderInterface
|
||||
final class UserRepository extends NamedDBElementRepository implements PasswordUpgraderInterface
|
||||
{
|
||||
protected $anonymous_user;
|
||||
|
||||
|
@ -74,11 +74,14 @@ class UserRepository extends NamedDBElementRepository implements PasswordUpgrade
|
|||
->where('u.name = (:name)')
|
||||
->orWhere('u.email = (:email)');
|
||||
|
||||
$qb->setParameters(['email' => $name_or_password, 'name' => $name_or_password]);
|
||||
$qb->setParameters([
|
||||
'email' => $name_or_password,
|
||||
'name' => $name_or_password,
|
||||
]);
|
||||
|
||||
try {
|
||||
return $qb->getQuery()->getOneOrNullResult();
|
||||
} catch (NonUniqueResultException $exception) {
|
||||
} catch (NonUniqueResultException $nonUniqueResultException) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue