mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
apply rules rector up to php82
This commit is contained in:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
|
||||
'confidential',
|
||||
];
|
||||
|
||||
public function __construct(private AddressRender $addressRender)
|
||||
public function __construct(private readonly AddressRender $addressRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
public function __construct(private UserRepository $userRepository)
|
||||
public function __construct(private readonly UserRepository $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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 = [])
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
public function __construct(private MetadataExtractor $metadataExtractor)
|
||||
public function __construct(private readonly MetadataExtractor $metadataExtractor)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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 = [
|
||||
|
Reference in New Issue
Block a user