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

@@ -15,7 +15,7 @@ use Chill\MainBundle\Pagination\PaginatorInterface;
class Collection
{
public function __construct(private $items, private PaginatorInterface $paginator)
public function __construct(private $items, private readonly PaginatorInterface $paginator)
{
}

View File

@@ -48,7 +48,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
'confidential',
];
public function __construct(private AddressRender $addressRender)
public function __construct(private readonly AddressRender $addressRender)
{
}

View File

@@ -22,7 +22,7 @@ use function array_key_exists;
class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
{
public function __construct(private CenterRepository $repository)
public function __construct(private readonly CenterRepository $repository)
{
}

View File

@@ -25,7 +25,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa
{
use NormalizerAwareTrait;
public function __construct(private UserRepository $userRepository)
public function __construct(private readonly UserRepository $userRepository)
{
}

View File

@@ -26,7 +26,7 @@ use function is_array;
class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInterface
{
public function __construct(private RequestStack $requestStack, private ParameterBagInterface $parameterBag)
public function __construct(private readonly RequestStack $requestStack, private readonly ParameterBagInterface $parameterBag)
{
}

View File

@@ -32,12 +32,12 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
* Should be present in context and contains an array of
* allowed types.
*/
public const ALLOWED_TYPES = 'denormalize_multi.allowed_types';
final public const ALLOWED_TYPES = 'denormalize_multi.allowed_types';
/**
* The type to set for enabling this type.
*/
public const TYPE = '@multi';
final public const TYPE = '@multi';
public function denormalize($data, $type, $format = null, array $context = [])
{

View File

@@ -23,7 +23,7 @@ use function is_array;
class DoctrineExistingEntityNormalizer implements DenormalizerInterface
{
public function __construct(private EntityManagerInterface $em, private ClassMetadataFactoryInterface $serializerMetadataFactory)
public function __construct(private readonly EntityManagerInterface $em, private readonly ClassMetadataFactoryInterface $serializerMetadataFactory)
{
}

View File

@@ -23,7 +23,7 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn
{
use NormalizerAwareTrait;
public function __construct(private EntityWorkflowManager $entityWorkflowManager, private MetadataExtractor $metadataExtractor, private Registry $registry)
public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry)
{
}

View File

@@ -21,7 +21,7 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz
{
use NormalizerAwareTrait;
public function __construct(private MetadataExtractor $metadataExtractor)
public function __construct(private readonly MetadataExtractor $metadataExtractor)
{
}

View File

@@ -24,7 +24,7 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte
{
use NormalizerAwareTrait;
public function __construct(private NotificationHandlerManager $notificationHandlerManager, private EntityManagerInterface $entityManager, private Security $security)
public function __construct(private readonly NotificationHandlerManager $notificationHandlerManager, private readonly EntityManagerInterface $entityManager, private readonly Security $security)
{
}

View File

@@ -21,9 +21,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
class PhonenumberNormalizer implements ContextAwareNormalizerInterface, DenormalizerInterface
{
private string $defaultCarrierCode;
private readonly string $defaultCarrierCode;
private PhoneNumberUtil $phoneNumberUtil;
private readonly PhoneNumberUtil $phoneNumberUtil;
public function __construct(ParameterBagInterface $parameterBag)
{

View File

@@ -18,7 +18,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, DenormalizerInterface
{
public function __construct(private Security $security)
public function __construct(private readonly Security $security)
{
}

View File

@@ -26,7 +26,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
{
use NormalizerAwareTrait;
public const NULL_USER = [
final public const NULL_USER = [
'type' => 'user',
'id' => '',
'username' => '',
@@ -36,7 +36,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
'email' => '',
];
public function __construct(private UserRender $userRender)
public function __construct(private readonly UserRender $userRender)
{
}
@@ -65,14 +65,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
);
if (null === $object && 'docgen' === $format) {
return array_merge(self::NULL_USER, [
'civility' => $this->normalizer->normalize(null, $format, $civilityContext),
'user_job' => $this->normalizer->normalize(null, $format, $userJobContext),
'main_center' => $this->normalizer->normalize(null, $format, $centerContext),
'main_scope' => $this->normalizer->normalize(null, $format, $scopeContext),
'current_location' => $this->normalizer->normalize(null, $format, $locationContext),
'main_location' => $this->normalizer->normalize(null, $format, $locationContext),
]);
return [...self::NULL_USER, 'civility' => $this->normalizer->normalize(null, $format, $civilityContext), 'user_job' => $this->normalizer->normalize(null, $format, $userJobContext), 'main_center' => $this->normalizer->normalize(null, $format, $centerContext), 'main_scope' => $this->normalizer->normalize(null, $format, $scopeContext), 'current_location' => $this->normalizer->normalize(null, $format, $locationContext), 'main_location' => $this->normalizer->normalize(null, $format, $locationContext)];
}
$data = [