diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php index 039e964..c21767f 100644 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -2,21 +2,12 @@ namespace App\Controller; -use App\Entity\User; -use App\Enum\RoleEnum; -use App\Form\RegisterFormType; -use App\Manager\Auth\RegistrationManager; -use App\Manager\Auth\SessionManager; use FOS\RestBundle\Controller\AbstractFOSRestController; use FOS\RestBundle\Controller\Annotations as Rest; use FOS\RestBundle\Controller\Annotations\Route; use FOS\RestBundle\View\View; -use Nelmio\ApiDocBundle\Annotation\Model; use OpenApi\Attributes as OA; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Security\Http\Attribute\CurrentUser; -use Symfony\Component\Security\Http\Attribute\IsGranted; #[OA\Tag(name: 'Home')] #[Route(path: '/api')] diff --git a/src/Manager/AbstractManager.php b/src/Manager/AbstractManager.php index d9cfc30..2bb68e3 100644 --- a/src/Manager/AbstractManager.php +++ b/src/Manager/AbstractManager.php @@ -23,6 +23,7 @@ public function __construct( /* @phpstan-ignore-next-line */ if ($token && $token->getUser() && !is_string($token->getUser())) { + /* @phpstan-ignore-next-line */ $this->user = $token->getUser(); } } diff --git a/src/Repository/ContentRepository.php b/src/Repository/ContentRepository.php index e8a0a15..38eead5 100644 --- a/src/Repository/ContentRepository.php +++ b/src/Repository/ContentRepository.php @@ -30,6 +30,9 @@ public function get(string $id): ?Content ->getOneOrNullResult(); } + /** + * @return Content[] + */ public function list(string $userId): array { return $this->createQueryBuilder('c') diff --git a/tests/Controller/Auth/LoginTest.php b/tests/Controller/Auth/LoginTest.php index 4aee30b..cee60d6 100644 --- a/tests/Controller/Auth/LoginTest.php +++ b/tests/Controller/Auth/LoginTest.php @@ -3,7 +3,6 @@ namespace App\Tests\Controller\Auth; use App\Tests\Base\AbstractTest; -use function json_encode; class LoginTest extends AbstractTest { diff --git a/tests/Controller/Auth/RegisterTest.php b/tests/Controller/Auth/RegisterTest.php index 135d34d..89c5a4a 100644 --- a/tests/Controller/Auth/RegisterTest.php +++ b/tests/Controller/Auth/RegisterTest.php @@ -5,8 +5,6 @@ use App\Factory\UserFactory; use App\Tests\Base\AbstractTest; use Symfony\Component\HttpFoundation\Response; -use function json_encode; -use const JSON_THROW_ON_ERROR; class RegisterTest extends AbstractTest { diff --git a/tests/Controller/Content/DeleteContentTest.php b/tests/Controller/Content/DeleteContentTest.php index 80a3f09..fc3943b 100644 --- a/tests/Controller/Content/DeleteContentTest.php +++ b/tests/Controller/Content/DeleteContentTest.php @@ -3,7 +3,6 @@ namespace App\Tests\Controller\Content; use App\Factory\ContentFactory; -use App\Factory\ProfileFactory; use App\Factory\UserFactory; use App\Tests\Base\AbstractTest; use Symfony\Component\HttpFoundation\Response; diff --git a/tests/Controller/Content/ListContentTest.php b/tests/Controller/Content/ListContentTest.php index d1af771..5f90199 100644 --- a/tests/Controller/Content/ListContentTest.php +++ b/tests/Controller/Content/ListContentTest.php @@ -6,7 +6,6 @@ use App\Factory\UserFactory; use App\Tests\Base\AbstractTest; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Zenstruck\Foundry\Test\Factories; diff --git a/tests/Controller/Profile/CreateProfileTest.php b/tests/Controller/Profile/CreateProfileTest.php index 5e202db..da42fd0 100644 --- a/tests/Controller/Profile/CreateProfileTest.php +++ b/tests/Controller/Profile/CreateProfileTest.php @@ -8,8 +8,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Zenstruck\Foundry\Test\Factories; -use function json_encode; -use const JSON_THROW_ON_ERROR; class CreateProfileTest extends AbstractTest {