apply rules rector up to php82

This commit is contained in:
2023-05-01 21:39:45 +02:00
parent 81e8928344
commit 6d63177ff4
733 changed files with 1257 additions and 1322 deletions

View File

@@ -28,7 +28,7 @@ use function trim;
final class AddressReferenceAPIController extends ApiController
{
public function __construct(private AddressReferenceRepository $addressReferenceRepository, private PaginatorFactory $paginatorFactory)
public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory)
{
}
@@ -45,7 +45,7 @@ final class AddressReferenceAPIController extends ApiController
$pattern = $request->query->get('q');
if ('' === trim($pattern)) {
if ('' === trim((string) $pattern)) {
throw new BadRequestHttpException('the search pattern is empty');
}

View File

@@ -23,7 +23,7 @@ use Symfony\Component\Serializer\SerializerInterface;
class AddressToReferenceMatcherController
{
public function __construct(private Security $security, private EntityManagerInterface $entityManager, private SerializerInterface $serializer)
public function __construct(private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SerializerInterface $serializer)
{
}

View File

@@ -47,7 +47,7 @@ use function unserialize;
*/
class ExportController extends AbstractController
{
public function __construct(private ChillRedis $redis, private ExportManager $exportManager, private FormFactoryInterface $formFactory, private LoggerInterface $logger, private SessionInterface $session, private TranslatorInterface $translator, private EntityManagerInterface $entityManager)
public function __construct(private readonly ChillRedis $redis, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly LoggerInterface $logger, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly EntityManagerInterface $entityManager)
{
}
@@ -234,7 +234,7 @@ class ExportController extends AbstractController
{
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
$exportManager = $this->exportManager;
$isGenerate = str_starts_with($step, 'generate_');
$isGenerate = str_starts_with((string) $step, 'generate_');
$builder = $this->formFactory
->createNamedBuilder(null, FormType::class, [], [

View File

@@ -24,7 +24,7 @@ use Symfony\Component\Serializer\SerializerInterface;
class GeographicalUnitByAddressApiController
{
public function __construct(private PaginatorFactory $paginatorFactory, private GeographicalUnitRepositoryInterface $geographicalUnitRepository, private Security $security, private SerializerInterface $serializer)
public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly Security $security, private readonly SerializerInterface $serializer)
{
}

View File

@@ -33,7 +33,7 @@ use UnexpectedValueException;
*/
class NotificationApiController
{
public function __construct(private EntityManagerInterface $entityManager, private NotificationRepository $notificationRepository, private PaginatorFactory $paginatorFactory, private Security $security, private SerializerInterface $serializer)
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer)
{
}

View File

@@ -41,7 +41,7 @@ use function in_array;
*/
class NotificationController extends AbstractController
{
public function __construct(private EntityManagerInterface $em, private LoggerInterface $chillLogger, private LoggerInterface $logger, private Security $security, private NotificationRepository $notificationRepository, private NotificationHandlerManager $notificationHandlerManager, private PaginatorFactory $paginatorFactory, private TranslatorInterface $translator, private UserRepository $userRepository)
public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly Security $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository)
{
}

View File

@@ -24,7 +24,7 @@ use function json_decode;
class PermissionApiController extends AbstractController
{
public function __construct(private DenormalizerInterface $denormalizer, private Security $security)
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly Security $security)
{
}

View File

@@ -37,7 +37,7 @@ class PermissionsGroupController extends AbstractController
/**
* PermissionsGroupController constructor.
*/
public function __construct(private TranslatableStringHelper $translatableStringHelper, private RoleProvider $roleProvider, private RoleHierarchy $roleHierarchy, private TranslatorInterface $translator, private ValidatorInterface $validator)
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly RoleProvider $roleProvider, private readonly RoleHierarchy $roleHierarchy, private readonly TranslatorInterface $translator, private readonly ValidatorInterface $validator)
{
}

View File

@@ -26,7 +26,7 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
final class PostalCodeAPIController extends ApiController
{
public function __construct(private CountryRepository $countryRepository, private PostalCodeRepositoryInterface $postalCodeRepository, private PaginatorFactory $paginatorFactory)
public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory)
{
}
@@ -43,7 +43,7 @@ final class PostalCodeAPIController extends ApiController
$pattern = $request->query->get('q');
if ('' === trim($pattern)) {
if ('' === trim((string) $pattern)) {
throw new BadRequestHttpException('the search pattern is empty');
}

View File

@@ -36,7 +36,7 @@ use function count;
class SavedExportController
{
public function __construct(private EngineInterface $templating, private EntityManagerInterface $entityManager, private ExportManager $exportManager, private FormFactoryInterface $formFactory, private SavedExportRepositoryInterface $savedExportRepository, private Security $security, private SessionInterface $session, private TranslatorInterface $translator, private UrlGeneratorInterface $urlGenerator)
public function __construct(private readonly EngineInterface $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator)
{
}

View File

@@ -103,7 +103,7 @@ class SearchController extends AbstractController
public function searchAction(Request $request, $_format)
{
$pattern = trim($request->query->get('q', ''));
$pattern = trim((string) $request->query->get('q', ''));
if ('' === $pattern) {
switch ($_format) {

View File

@@ -22,7 +22,7 @@ use function count;
class TimelineCenterController extends AbstractController
{
public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private Security $security)
public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security)
{
}

View File

@@ -36,9 +36,9 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
class UserController extends CRUDController
{
public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter';
final public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter';
public function __construct(private LoggerInterface $logger, private ValidatorInterface $validator, private UserPasswordEncoderInterface $passwordEncoder, private UserRepository $userRepository, protected ParameterBagInterface $parameterBag)
public function __construct(private readonly LoggerInterface $logger, private readonly ValidatorInterface $validator, private readonly UserPasswordEncoderInterface $passwordEncoder, private readonly UserRepository $userRepository, protected ParameterBagInterface $parameterBag)
{
}

View File

@@ -30,7 +30,7 @@ use Symfony\Component\Serializer\SerializerInterface;
class WorkflowApiController
{
public function __construct(private EntityManagerInterface $entityManager, private EntityWorkflowRepository $entityWorkflowRepository, private PaginatorFactory $paginatorFactory, private Security $security, private SerializerInterface $serializer)
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer)
{
}

View File

@@ -39,7 +39,7 @@ use function count;
class WorkflowController extends AbstractController
{
public function __construct(private EntityWorkflowManager $entityWorkflowManager, private EntityWorkflowRepository $entityWorkflowRepository, private ValidatorInterface $validator, private PaginatorFactory $paginatorFactory, private Registry $registry, private EntityManagerInterface $entityManager, private TranslatorInterface $translator, private Security $security)
public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly ValidatorInterface $validator, private readonly PaginatorFactory $paginatorFactory, private readonly Registry $registry, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly Security $security)
{
}