diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 8de8fd88..77cd1df4 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -64,6 +64,7 @@ ], 'sort_algorithm' => 'none', ], + 'phpdoc_separation' => false ]) ->setFinder($finder) ; diff --git a/src/Cache/CacheWarmer/BackgroundImageCacheWarmer.php b/src/Cache/CacheWarmer/BackgroundImageCacheWarmer.php index 20aae7ae..98cecc3e 100644 --- a/src/Cache/CacheWarmer/BackgroundImageCacheWarmer.php +++ b/src/Cache/CacheWarmer/BackgroundImageCacheWarmer.php @@ -35,7 +35,7 @@ public function isOptional(): bool protected function findImagesToCache(): array { - $imagesIterator = (Finder::create())->in($this->backgroundImagesDirectory)->files()->getIterator(); + $imagesIterator = Finder::create()->in($this->backgroundImagesDirectory)->files()->getIterator(); $images = array_map(static fn (\SplFileInfo $imageFile) => $imageFile->getFilename(), iterator_to_array($imagesIterator)); diff --git a/src/Command/PermissionsMakeAdminCommand.php b/src/Command/PermissionsMakeAdminCommand.php index 7736d4df..44a41fca 100644 --- a/src/Command/PermissionsMakeAdminCommand.php +++ b/src/Command/PermissionsMakeAdminCommand.php @@ -8,6 +8,7 @@ use App\Repository\User\UserRepository; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -55,6 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $allUsersNames = array_map(static fn (User $user) => sprintf('%d (%s)', $user->getExternalId(), $user->getUsername()), $allUsers); + /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); $question = new ChoiceQuestion('Please select user from the list', $allUsersNames); diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index 73b1b4ae..7ff388b5 100644 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -7,7 +7,6 @@ use App\Security\Authenticator\DiscordAuthenticator; use App\Security\Enum\ScopeEnum; use KnpU\OAuth2ClientBundle\Client\ClientRegistry; -use RuntimeException; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Response; @@ -42,22 +41,22 @@ public function connectAction(ClientRegistry $clientRegistry): RedirectResponse /** * @Route("/connect/discord/check", name="_connect_discord_check") * - * @throws RuntimeException + * @throws \RuntimeException * * @see DiscordAuthenticator */ public function connectCheckAction(): Response { - throw new RuntimeException('This should never be executed!'); + throw new \RuntimeException('This should never be executed!'); } /** * @Route("/logout", name="_logout") * - * @throws RuntimeException + * @throws \RuntimeException */ public function logoutAction(): Response { - throw new RuntimeException('This should never be executed!'); + throw new \RuntimeException('This should never be executed!'); } } diff --git a/src/EventSubscriber/Doctrine/ModGroupUpdatedSubscriber.php b/src/EventSubscriber/Doctrine/ModGroupUpdatedSubscriber.php index 2f95222f..04f6f2d4 100644 --- a/src/EventSubscriber/Doctrine/ModGroupUpdatedSubscriber.php +++ b/src/EventSubscriber/Doctrine/ModGroupUpdatedSubscriber.php @@ -53,8 +53,10 @@ public function postFlush(PostFlushEventArgs $args): void } $entityManager = $args->getEntityManager(); + /** @var ModListRepository $modListRepository */ $modListRepository = $entityManager->getRepository(ModList::class); + /** @var null|User $currentUser */ $currentUser = $this->security->getUser(); diff --git a/src/Form/DataTransformerRegistry.php b/src/Form/DataTransformerRegistry.php index e687729d..875e0d37 100644 --- a/src/Form/DataTransformerRegistry.php +++ b/src/Form/DataTransformerRegistry.php @@ -43,8 +43,8 @@ private function createException(FormDtoInterface $formDto, EntityInterface $ent return new \InvalidArgumentException( sprintf( 'None of the registered data transformers supports transformation of "%s" to "%s"', - \get_class($formDto), - $entity ? \get_class($formDto) : 'null', + $formDto::class, + $entity ? $formDto::class : 'null', ) ); }