mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 10:24:31 +02:00
Use imports instead of FQNs
This commit is contained in:
parent
f63b6d7207
commit
5629215ce4
179 changed files with 792 additions and 597 deletions
|
@ -22,12 +22,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Validator\Constraints;
|
||||
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use App\Entity\UserSystem\Group;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Services\UserSystem\PermissionManager;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
|
||||
|
@ -35,7 +36,7 @@ class NoLockoutValidator extends ConstraintValidator
|
|||
{
|
||||
protected array $perm_structure;
|
||||
|
||||
public function __construct(protected PermissionManager $resolver, protected \Symfony\Bundle\SecurityBundle\Security $security, protected EntityManagerInterface $entityManager)
|
||||
public function __construct(protected PermissionManager $resolver, protected Security $security, protected EntityManagerInterface $entityManager)
|
||||
{
|
||||
$this->perm_structure = $resolver->getPermissionStructure();
|
||||
}
|
||||
|
@ -58,7 +59,7 @@ class NoLockoutValidator extends ConstraintValidator
|
|||
if ($perm_holder instanceof User || $perm_holder instanceof Group) {
|
||||
$user = $this->security->getUser();
|
||||
|
||||
if (!$user instanceof \Symfony\Component\Security\Core\User\UserInterface) {
|
||||
if (!$user instanceof UserInterface) {
|
||||
$user = $this->entityManager->getRepository(User::class)->getAnonymousUser();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue