mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-08 20:19:30 +00:00
Applied rector with PHP8.1 migration rules
This commit is contained in:
parent
dc6a67c2f0
commit
7ee01d9a05
303 changed files with 1228 additions and 3465 deletions
|
|
@ -35,17 +35,8 @@ use Symfony\Component\Security\Core\Security;
|
|||
*/
|
||||
class UpgradePermissionsSchemaSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
private \Symfony\Bundle\SecurityBundle\Security $security;
|
||||
private PermissionSchemaUpdater $permissionSchemaUpdater;
|
||||
private EntityManagerInterface $entityManager;
|
||||
private EventCommentHelper $eventCommentHelper;
|
||||
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, PermissionSchemaUpdater $permissionSchemaUpdater, EntityManagerInterface $entityManager, EventCommentHelper $eventCommentHelper)
|
||||
public function __construct(private readonly \Symfony\Bundle\SecurityBundle\Security $security, private readonly PermissionSchemaUpdater $permissionSchemaUpdater, private readonly EntityManagerInterface $entityManager, private readonly EventCommentHelper $eventCommentHelper)
|
||||
{
|
||||
$this->security = $security;
|
||||
$this->permissionSchemaUpdater = $permissionSchemaUpdater;
|
||||
$this->entityManager = $entityManager;
|
||||
$this->eventCommentHelper = $eventCommentHelper;
|
||||
}
|
||||
|
||||
public function onRequest(RequestEvent $event): void
|
||||
|
|
@ -55,7 +46,7 @@ class UpgradePermissionsSchemaSubscriber implements EventSubscriberInterface
|
|||
}
|
||||
|
||||
$user = $this->security->getUser();
|
||||
if (null === $user) {
|
||||
if (!$user instanceof \Symfony\Component\Security\Core\User\UserInterface) {
|
||||
//Retrieve anonymous user
|
||||
$user = $this->entityManager->getRepository(User::class)->getAnonymousUser();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue