mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -15,14 +15,8 @@ use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
|
||||
class Collection
|
||||
{
|
||||
private $items;
|
||||
|
||||
private PaginatorInterface $paginator;
|
||||
|
||||
public function __construct($items, PaginatorInterface $paginator)
|
||||
public function __construct(private $items, private PaginatorInterface $paginator)
|
||||
{
|
||||
$this->items = $items;
|
||||
$this->paginator = $paginator;
|
||||
}
|
||||
|
||||
public function getItems()
|
||||
|
@@ -15,11 +15,8 @@ use JsonSerializable;
|
||||
|
||||
class Counter implements JsonSerializable
|
||||
{
|
||||
private int $counter;
|
||||
|
||||
public function __construct(?int $counter)
|
||||
public function __construct(private ?int $counter)
|
||||
{
|
||||
$this->counter = $counter;
|
||||
}
|
||||
|
||||
public function getCounter(): ?int
|
||||
|
@@ -48,11 +48,8 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
|
||||
'confidential',
|
||||
];
|
||||
|
||||
private AddressRender $addressRender;
|
||||
|
||||
public function __construct(AddressRender $addressRender)
|
||||
public function __construct(private AddressRender $addressRender)
|
||||
{
|
||||
$this->addressRender = $addressRender;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -22,11 +22,8 @@ use function array_key_exists;
|
||||
|
||||
class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
|
||||
{
|
||||
private CenterRepository $repository;
|
||||
|
||||
public function __construct(CenterRepository $repository)
|
||||
public function __construct(private CenterRepository $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
|
@@ -25,11 +25,8 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private UserRepository $userRepository;
|
||||
|
||||
public function __construct(UserRepository $userRepository)
|
||||
public function __construct(private UserRepository $userRepository)
|
||||
{
|
||||
$this->userRepository = $userRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,14 +26,8 @@ use function is_array;
|
||||
|
||||
class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInterface
|
||||
{
|
||||
private ParameterBagInterface $parameterBag;
|
||||
|
||||
private RequestStack $requestStack;
|
||||
|
||||
public function __construct(RequestStack $requestStack, ParameterBagInterface $parameterBag)
|
||||
public function __construct(private RequestStack $requestStack, private ParameterBagInterface $parameterBag)
|
||||
{
|
||||
$this->requestStack = $requestStack;
|
||||
$this->parameterBag = $parameterBag;
|
||||
}
|
||||
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
|
@@ -23,14 +23,8 @@ use function is_array;
|
||||
|
||||
class DoctrineExistingEntityNormalizer implements DenormalizerInterface
|
||||
{
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private ClassMetadataFactoryInterface $serializerMetadataFactory;
|
||||
|
||||
public function __construct(EntityManagerInterface $em, ClassMetadataFactoryInterface $serializerMetadataFactory)
|
||||
public function __construct(private EntityManagerInterface $em, private ClassMetadataFactoryInterface $serializerMetadataFactory)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->serializerMetadataFactory = $serializerMetadataFactory;
|
||||
}
|
||||
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
|
@@ -23,20 +23,8 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private EntityWorkflowManager $entityWorkflowManager;
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
public function __construct(
|
||||
EntityWorkflowManager $entityWorkflowManager,
|
||||
MetadataExtractor $metadataExtractor,
|
||||
Registry $registry
|
||||
) {
|
||||
$this->entityWorkflowManager = $entityWorkflowManager;
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
$this->registry = $registry;
|
||||
public function __construct(private EntityWorkflowManager $entityWorkflowManager, private MetadataExtractor $metadataExtractor, private Registry $registry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,11 +21,8 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
public function __construct(MetadataExtractor $metadataExtractor)
|
||||
public function __construct(private MetadataExtractor $metadataExtractor)
|
||||
{
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -24,17 +24,8 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
||||
private NotificationHandlerManager $notificationHandlerManager;
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(NotificationHandlerManager $notificationHandlerManager, EntityManagerInterface $entityManager, Security $security)
|
||||
public function __construct(private NotificationHandlerManager $notificationHandlerManager, private EntityManagerInterface $entityManager, private Security $security)
|
||||
{
|
||||
$this->notificationHandlerManager = $notificationHandlerManager;
|
||||
$this->entityManager = $entityManager;
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,11 +18,8 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, DenormalizerInterface
|
||||
{
|
||||
private Security $security;
|
||||
|
||||
public function __construct(Security $security)
|
||||
public function __construct(private Security $security)
|
||||
{
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
public function denormalize($data, string $type, ?string $format = null, array $context = []): PrivateCommentEmbeddable
|
||||
|
@@ -36,11 +36,8 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
|
||||
'email' => '',
|
||||
];
|
||||
|
||||
private UserRender $userRender;
|
||||
|
||||
public function __construct(UserRender $userRender)
|
||||
public function __construct(private UserRender $userRender)
|
||||
{
|
||||
$this->userRender = $userRender;
|
||||
}
|
||||
|
||||
public function normalize($object, $format = null, array $context = [])
|
||||
|
Reference in New Issue
Block a user