mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +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
|
@ -27,6 +27,7 @@ namespace App\Repository;
|
|||
use App\Entity\Base\StructuralDBElement;
|
||||
use App\Helpers\Trees\StructuralDBElementIterator;
|
||||
use App\Helpers\Trees\TreeViewNode;
|
||||
use RecursiveIteratorIterator;
|
||||
|
||||
class StructuralDBElementRepository extends NamedDBElementRepository
|
||||
{
|
||||
|
@ -80,7 +81,7 @@ class StructuralDBElementRepository extends NamedDBElementRepository
|
|||
$entities = $this->findBy(['parent' => $parent], ['name' => 'ASC']);
|
||||
|
||||
$elementIterator = new StructuralDBElementIterator($entities);
|
||||
$recursiveIterator = new \RecursiveIteratorIterator($elementIterator, \RecursiveIteratorIterator::SELF_FIRST);
|
||||
$recursiveIterator = new RecursiveIteratorIterator($elementIterator, RecursiveIteratorIterator::SELF_FIRST);
|
||||
//$result = iterator_to_array($recursiveIterator);
|
||||
|
||||
//We can not use iterator_to_array here or we get only the parent elements
|
||||
|
|
|
@ -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