Internal: Change ResourceControllerTrait::getUser() return type to return UserInterface (compatible with ResourceControllerTrait::getUser())

pull/5146/head
Yannick Warnier 2 years ago
parent c9ec2eaa97
commit ad1e943485
  1. 5
      src/CoreBundle/Traits/ResourceControllerTrait.php

@ -16,6 +16,7 @@ use Doctrine\ORM\EntityNotFoundException;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\User\UserInterface;
trait ResourceControllerTrait trait ResourceControllerTrait
{ {
@ -112,9 +113,9 @@ trait ResourceControllerTrait
} }
/** /**
* @return User|null * @return ?UserInterface
*/ */
protected function getUser() protected function getUser(): ?UserInterface
{ {
/*if (!$this->container->has('security.token_storage')) { /*if (!$this->container->has('security.token_storage')) {
throw new \LogicException('The SecurityBundle is not registered in your application. Try running "composer require symfony/security-bundle".'); throw new \LogicException('The SecurityBundle is not registered in your application. Try running "composer require symfony/security-bundle".');

Loading…
Cancel
Save