diff --git a/src/core/Ab/AbTest.php b/src/core/Ab/AbTest.php index 47f52c4..aef9bf4 100644 --- a/src/core/Ab/AbTest.php +++ b/src/core/Ab/AbTest.php @@ -10,14 +10,12 @@ namespace App\Core\Ab; class AbTest implements AbTestInterface { protected $results; - protected string $name; protected array $variations = []; protected array $probabilities = []; protected int $duration = 3600 * 24; - public function __construct(string $name) + public function __construct(protected string $name) { - $this->name = $name; } public function getName(): string diff --git a/src/core/Analytic/DateRangeAnalytic.php b/src/core/Analytic/DateRangeAnalytic.php index 0588b95..bd6a6ed 100644 --- a/src/core/Analytic/DateRangeAnalytic.php +++ b/src/core/Analytic/DateRangeAnalytic.php @@ -13,18 +13,16 @@ use App\Core\Repository\Analytic\ViewRepositoryQuery; */ class DateRangeAnalytic { - protected ViewRepositoryQuery $viewQuery; - protected RefererRepositoryQuery $refererQuery; protected ?Node $node; protected ?\DateTime $from; protected ?\DateTime $to; protected bool $reload = true; protected array $cache = []; - public function __construct(ViewRepositoryQuery $viewQuery, RefererRepositoryQuery $refererQuery) - { - $this->viewQuery = $viewQuery; - $this->refererQuery = $refererQuery; + public function __construct( + protected ViewRepositoryQuery $viewQuery, + protected RefererRepositoryQuery $refererQuery + ) { } public function getViews(): array diff --git a/src/core/Annotation/UrlGenerator.php b/src/core/Annotation/UrlGenerator.php index 2afa0b4..f397bb7 100644 --- a/src/core/Annotation/UrlGenerator.php +++ b/src/core/Annotation/UrlGenerator.php @@ -10,16 +10,10 @@ namespace App\Core\Annotation; #[\Attribute] class UrlGenerator { - public string $service; - - public string $method; - - public array $options = []; - - public function __construct(string $service, string $method, array $options = []) - { - $this->service = $service; - $this->method = $method; - $this->options = $options; + public function __construct( + public string $service, + public string $method, + public array $options = [] + ) { } } diff --git a/src/core/Authenticator/LoginFormAuthenticator.php b/src/core/Authenticator/LoginFormAuthenticator.php index 193c61f..cb1f957 100644 --- a/src/core/Authenticator/LoginFormAuthenticator.php +++ b/src/core/Authenticator/LoginFormAuthenticator.php @@ -23,20 +23,12 @@ class LoginFormAuthenticator extends AbstractFormLoginAuthenticator { use TargetPathTrait; - private EntityManagerInterface $entityManager; - - private UrlGeneratorInterface $urlGenerator; - - private CsrfTokenManagerInterface $csrfTokenManager; - - private UserPasswordEncoderInterface $passwordEncoder; - - public function __construct(EntityManagerInterface $entityManager, UrlGeneratorInterface $urlGenerator, CsrfTokenManagerInterface $csrfTokenManager, UserPasswordEncoderInterface $passwordEncoder) - { - $this->entityManager = $entityManager; - $this->urlGenerator = $urlGenerator; - $this->csrfTokenManager = $csrfTokenManager; - $this->passwordEncoder = $passwordEncoder; + public function __construct( + private EntityManagerInterface $entityManager, + private UrlGeneratorInterface $urlGenerator, + private CsrfTokenManagerInterface $csrfTokenManager, + private UserPasswordEncoderInterface $passwordEncoder + ) { } public function supports(Request $request) diff --git a/src/core/Cache/SymfonyCacheManager.php b/src/core/Cache/SymfonyCacheManager.php index c1ad5e3..8e4e500 100644 --- a/src/core/Cache/SymfonyCacheManager.php +++ b/src/core/Cache/SymfonyCacheManager.php @@ -20,15 +20,11 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; */ class SymfonyCacheManager { - protected KernelInterface $kernel; - protected HttpClientInterface $httpClient; - protected UrlGeneratorInterface $urlGenerator; - - public function __construct(KernelInterface $kernel, HttpClientInterface $httpClient, UrlGeneratorInterface $urlGenerator) - { - $this->kernel = $kernel; - $this->httpClient = $httpClient; - $this->urlGenerator = $urlGenerator; + public function __construct( + protected KernelInterface $kernel, + protected HttpClientInterface $httpClient, + protected UrlGeneratorInterface $urlGenerator + ) { } public function cleanRouting() diff --git a/src/core/Command/UserCreateCommand.php b/src/core/Command/UserCreateCommand.php index 598bfaf..7c1ecdc 100644 --- a/src/core/Command/UserCreateCommand.php +++ b/src/core/Command/UserCreateCommand.php @@ -18,19 +18,12 @@ class UserCreateCommand extends Command { protected static $defaultName = 'murph:user:create'; protected static $defaultDescription = 'Creates a user'; - protected UserFactory $userFactory; - protected EntityManager $entityManager; - protected TokenGeneratorInterface $tokenGenerator; public function __construct( - UserFactory $userFactory, - EntityManager $entityManager, - TokenGeneratorInterface $tokenGenerator + protected UserFactory $userFactory, + protected EntityManager $entityManager, + protected TokenGeneratorInterface $tokenGenerator ) { - $this->userFactory = $userFactory; - $this->entityManager = $entityManager; - $this->tokenGenerator = $tokenGenerator; - parent::__construct(); } diff --git a/src/core/Event/Ab/AbTestEvent.php b/src/core/Event/Ab/AbTestEvent.php index 922f9cc..1b8cd3a 100644 --- a/src/core/Event/Ab/AbTestEvent.php +++ b/src/core/Event/Ab/AbTestEvent.php @@ -15,11 +15,8 @@ class AbTestEvent extends Event public const INIT_EVENT = 'ab_test.init'; public const RUN_EVENT = 'ab_test.run'; - protected AbTest $test; - - public function __construct(AbTest $test) + public function __construct(protected AbTest $test) { - $this->test = $test; } public function getTest(): AbTest diff --git a/src/core/Event/Account/PasswordRequestEvent.php b/src/core/Event/Account/PasswordRequestEvent.php index 5f10383..8a876d5 100644 --- a/src/core/Event/Account/PasswordRequestEvent.php +++ b/src/core/Event/Account/PasswordRequestEvent.php @@ -14,11 +14,8 @@ class PasswordRequestEvent extends Event { public const EVENT = 'account_event.password_request'; - protected User $user; - - public function __construct(User $user) + public function __construct(protected User $user) { - $this->user = $user; } public function getUser(): User diff --git a/src/core/Event/EntityManager/EntityManagerEvent.php b/src/core/Event/EntityManager/EntityManagerEvent.php index 7f37961..fa38c93 100644 --- a/src/core/Event/EntityManager/EntityManagerEvent.php +++ b/src/core/Event/EntityManager/EntityManagerEvent.php @@ -19,11 +19,8 @@ class EntityManagerEvent extends Event public const PRE_UPDATE_EVENT = 'entity_manager_event.pre_update'; public const PRE_DELETE_EVENT = 'entity_manager_event.pre_delete'; - protected EntityInterface $entity; - - public function __construct(EntityInterface $entity) + public function __construct(protected EntityInterface $entity) { - $this->entity = $entity; } public function getEntity(): EntityInterface diff --git a/src/core/Event/Page/PageEditEvent.php b/src/core/Event/Page/PageEditEvent.php index 9893125..178ffee 100644 --- a/src/core/Event/Page/PageEditEvent.php +++ b/src/core/Event/Page/PageEditEvent.php @@ -14,12 +14,10 @@ class PageEditEvent extends Event { public const FORM_INIT_EVENT = 'page_edit_event.form_init'; - protected Page $page; protected array $pageBuilderOptions = []; - public function __construct(Page $page) + public function __construct(protected Page $page) { - $this->page = $page; } public function getPage() diff --git a/src/core/Event/Setting/NavigationSettingEvent.php b/src/core/Event/Setting/NavigationSettingEvent.php index 9646f63..1aa27e6 100644 --- a/src/core/Event/Setting/NavigationSettingEvent.php +++ b/src/core/Event/Setting/NavigationSettingEvent.php @@ -14,11 +14,8 @@ class NavigationSettingEvent extends Event public const INIT_EVENT = 'navigation_setting_event.init'; public const FORM_INIT_EVENT = 'navigation_setting_event.form_init'; - protected $data; - - public function __construct($data = null) + public function __construct(protected $data = null) { - $this->data = $data; } public function getData() diff --git a/src/core/Event/Setting/SettingEvent.php b/src/core/Event/Setting/SettingEvent.php index aa9713e..3dc2c99 100644 --- a/src/core/Event/Setting/SettingEvent.php +++ b/src/core/Event/Setting/SettingEvent.php @@ -14,11 +14,8 @@ class SettingEvent extends Event public const INIT_EVENT = 'setting_event.init'; public const FORM_INIT_EVENT = 'setting_event.form_init'; - protected $data; - - public function __construct($data = null) + public function __construct(protected $data = null) { - $this->data = $data; } public function getData() diff --git a/src/core/Event/Task/TaskRunRequestedEvent.php b/src/core/Event/Task/TaskRunRequestedEvent.php index d5ba7d0..7a3e19a 100644 --- a/src/core/Event/Task/TaskRunRequestedEvent.php +++ b/src/core/Event/Task/TaskRunRequestedEvent.php @@ -16,15 +16,11 @@ class TaskRunRequestedEvent extends Event { public const RUN_REQUEST_EVENT = 'task_event.run_request'; - protected string $task; - protected InputBag $parameters; - protected BufferedOutput $output; - - public function __construct(string $task, InputBag $parameters, BufferedOutput $output) - { - $this->task = $task; - $this->parameters = $parameters; - $this->output = $output; + public function __construct( + protected string $task, + protected InputBag $parameters, + protected BufferedOutput $output + ) { } public function getTask(): string diff --git a/src/core/EventListener/AbListener.php b/src/core/EventListener/AbListener.php index 87fb2a5..f2a1ebf 100644 --- a/src/core/EventListener/AbListener.php +++ b/src/core/EventListener/AbListener.php @@ -20,19 +20,13 @@ use Symfony\Component\HttpKernel\Event\ResponseEvent; */ class AbListener { - protected EventDispatcherInterface $eventDispatcher; - protected AbContainer $container; - protected SiteRequest $siteRequest; protected ?Node $node; public function __construct( - AbContainer $container, - EventDispatcherInterface $eventDispatcher, - SiteRequest $siteRequest + protected AbContainer $container, + protected EventDispatcherInterface $eventDispatcher, + protected SiteRequest $siteRequest ) { - $this->eventDispatcher = $eventDispatcher; - $this->container = $container; - $this->siteRequest = $siteRequest; } public function onKernelRequest(RequestEvent $event) diff --git a/src/core/EventListener/AnalyticListener.php b/src/core/EventListener/AnalyticListener.php index 645d053..23e186f 100644 --- a/src/core/EventListener/AnalyticListener.php +++ b/src/core/EventListener/AnalyticListener.php @@ -23,30 +23,18 @@ use Symfony\Component\HttpKernel\Event\RequestEvent; */ class AnalyticListener { - protected NodeRepository $nodeRepository; - protected ViewRepositoryQuery $viewRepositoryQuery; - protected ViewFactory $viewFactory; - protected RefererRepositoryQuery $refererRepositoryQuery; - protected RefererFactory $refererFactory; - protected EntityManager $manager; protected DeviceDetector $deviceDetector; protected Request $request; protected Node $node; public function __construct( - NodeRepository $nodeRepository, - ViewRepositoryQuery $viewRepositoryQuery, - ViewFactory $viewFactory, - RefererRepositoryQuery $refererRepositoryQuery, - RefererFactory $refererFactory, - EntityManager $manager + protected NodeRepository $nodeRepository, + protected ViewRepositoryQuery $viewRepositoryQuery, + protected ViewFactory $viewFactory, + protected RefererRepositoryQuery $refererRepositoryQuery, + protected RefererFactory $refererFactory, + protected EntityManager $manager ) { - $this->nodeRepository = $nodeRepository; - $this->viewRepositoryQuery = $viewRepositoryQuery; - $this->viewFactory = $viewFactory; - $this->refererRepositoryQuery = $refererRepositoryQuery; - $this->refererFactory = $refererFactory; - $this->manager = $manager; $this->createDeviceDetector(); } diff --git a/src/core/EventListener/RedirectListener.php b/src/core/EventListener/RedirectListener.php index 750a613..8791684 100644 --- a/src/core/EventListener/RedirectListener.php +++ b/src/core/EventListener/RedirectListener.php @@ -15,15 +15,11 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; */ class RedirectListener { - protected RedirectMatcher $matcher; - protected RedirectBuilder $builder; - protected RedirectRepositoryQuery $repository; - - public function __construct(RedirectMatcher $matcher, RedirectBuilder $builder, RedirectRepositoryQuery $repository) - { - $this->matcher = $matcher; - $this->builder = $builder; - $this->repository = $repository; + public function __construct( + protected RedirectMatcher $matcher, + protected RedirectBuilder $builder, + protected RedirectRepositoryQuery $repository + ) { } public function onKernelException(ExceptionEvent $event) diff --git a/src/core/EventSubscriber/Account/PasswordRequestEventSubscriber.php b/src/core/EventSubscriber/Account/PasswordRequestEventSubscriber.php index 8f2c5d2..aeca6d9 100644 --- a/src/core/EventSubscriber/Account/PasswordRequestEventSubscriber.php +++ b/src/core/EventSubscriber/Account/PasswordRequestEventSubscriber.php @@ -17,24 +17,13 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class PasswordRequestEventSubscriber implements EventSubscriberInterface { - protected MailNotifier $notifier; - protected UrlGeneratorInterface $urlGenerator; - protected EntityManager $entityManager; - protected TokenGeneratorInterface $tokenGenerator; - protected TranslatorInterface $translator; - public function __construct( - MailNotifier $notifier, - UrlGeneratorInterface $urlGenerator, - EntityManager $entityManager, - TokenGeneratorInterface $tokenGenerator, - TranslatorInterface $translator + protected MailNotifier $notifier, + protected UrlGeneratorInterface $urlGenerator, + protected EntityManager $entityManager, + protected TokenGeneratorInterface $tokenGenerator, + protected TranslatorInterface $translator ) { - $this->notifier = $notifier; - $this->urlGenerator = $urlGenerator; - $this->entityManager = $entityManager; - $this->tokenGenerator = $tokenGenerator; - $this->translator = $translator; } public static function getSubscribedEvents() diff --git a/src/core/EventSubscriber/RequestSecurityEventSubscriber.php b/src/core/EventSubscriber/RequestSecurityEventSubscriber.php index 00ede77..fd4483a 100644 --- a/src/core/EventSubscriber/RequestSecurityEventSubscriber.php +++ b/src/core/EventSubscriber/RequestSecurityEventSubscriber.php @@ -16,12 +16,12 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; */ class RequestSecurityEventSubscriber implements EventSubscriberInterface { - protected NodeRepository $nodeRepository; protected AuthorizationChecker $authorizationChecker; - public function __construct(NodeRepository $nodeRepository, ContainerInterface $container) - { - $this->nodeRepository = $nodeRepository; + public function __construct( + protected NodeRepository $nodeRepository, + ContainerInterface $container + ) { $this->authorizationChecker = $container->get('security.authorization_checker'); } diff --git a/src/core/EventSubscriber/Site/ForcedDomainEventSubscriber.php b/src/core/EventSubscriber/Site/ForcedDomainEventSubscriber.php index f823199..b86b0d6 100644 --- a/src/core/EventSubscriber/Site/ForcedDomainEventSubscriber.php +++ b/src/core/EventSubscriber/Site/ForcedDomainEventSubscriber.php @@ -11,11 +11,8 @@ use function Symfony\Component\String\u; class ForcedDomainEventSubscriber implements EventSubscriberInterface { - protected SiteRequest $siteRequest; - - public function __construct(SiteRequest $siteRequest) + public function __construct(protected SiteRequest $siteRequest) { - $this->siteRequest = $siteRequest; } public function onKernelResponse(ResponseEvent $event) diff --git a/src/core/EventSubscriber/Site/MenuEventSubscriber.php b/src/core/EventSubscriber/Site/MenuEventSubscriber.php index 6cc73ba..e706488 100644 --- a/src/core/EventSubscriber/Site/MenuEventSubscriber.php +++ b/src/core/EventSubscriber/Site/MenuEventSubscriber.php @@ -20,27 +20,14 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class MenuEventSubscriber extends EntityManagerEventSubscriber { - protected NodeFactory $nodeFactory; - protected NodeRepository $nodeRepository; - protected EntityManager $entityManager; - protected CodeSlugify $slugify; - protected SymfonyCacheManager $cacheManager; - protected TranslatorInterface $translation; - public function __construct( - NodeFactory $nodeFactory, - NodeRepository $nodeRepository, - EntityManager $entityManager, - CodeSlugify $slugify, - SymfonyCacheManager $cacheManager, - TranslatorInterface $translator + protected NodeFactory $nodeFactory, + protected NodeRepository $nodeRepository, + protected EntityManager $entityManager, + protected CodeSlugify $slugify, + protected SymfonyCacheManager $cacheManager, + protected TranslatorInterface $translator ) { - $this->nodeFactory = $nodeFactory; - $this->nodeRepository = $nodeRepository; - $this->entityManager = $entityManager; - $this->slugify = $slugify; - $this->cacheManager = $cacheManager; - $this->translator = $translator; } public function supports(EntityInterface $entity): bool diff --git a/src/core/EventSubscriber/Site/NavigationEventSubscriber.php b/src/core/EventSubscriber/Site/NavigationEventSubscriber.php index f666e4f..ed32dbd 100644 --- a/src/core/EventSubscriber/Site/NavigationEventSubscriber.php +++ b/src/core/EventSubscriber/Site/NavigationEventSubscriber.php @@ -17,11 +17,9 @@ use App\Core\Slugify\CodeSlugify; class NavigationEventSubscriber extends EntityManagerEventSubscriber { public function __construct( - EntityManager $entityManager, - CodeSlugify $slugify + protected EntityManager $entityManager, + protected CodeSlugify $slugify ) { - $this->entityManager = $entityManager; - $this->slugify = $slugify; } public function supports(EntityInterface $entity): bool diff --git a/src/core/EventSubscriber/Site/NodeEventSubscriber.php b/src/core/EventSubscriber/Site/NodeEventSubscriber.php index 5a0b6df..0705f25 100644 --- a/src/core/EventSubscriber/Site/NodeEventSubscriber.php +++ b/src/core/EventSubscriber/Site/NodeEventSubscriber.php @@ -12,7 +12,6 @@ use App\Core\Repository\Site\NodeRepository; use App\Core\Slugify\CodeSlugify; use App\Core\Slugify\RouteParameterSlugify; use App\Core\Slugify\Slugify; -use Symfony\Component\HttpKernel\KernelInterface; use function Symfony\Component\String\u; /** @@ -22,27 +21,14 @@ use function Symfony\Component\String\u; */ class NodeEventSubscriber extends EntityManagerEventSubscriber { - protected NodeFactory $nodeFactory; - protected EntityManager $entityManager; - protected KernelInterface $kernel; - protected Slugify $slugify; - protected CodeSlugify $codeSlugify; - protected RouteParameterSlugify $routeParameterSlugify; - public function __construct( - NodeFactory $nodeFactory, - NodeRepository $nodeRepository, - EntityManager $entityManager, - Slugify $slugify, - CodeSlugify $codeSlugify, - RouteParameterSlugify $routeParameterSlugify + protected NodeFactory $nodeFactory, + protected NodeRepository $nodeRepository, + protected EntityManager $entityManager, + protected Slugify $slugify, + protected CodeSlugify $codeSlugify, + protected RouteParameterSlugify $routeParameterSlugify ) { - $this->nodeFactory = $nodeFactory; - $this->nodeRepository = $nodeRepository; - $this->entityManager = $entityManager; - $this->slugify = $slugify; - $this->codeSlugify = $codeSlugify; - $this->routeParameterSlugify = $routeParameterSlugify; } public function supports(EntityInterface $entity): bool diff --git a/src/core/EventSubscriber/Site/Page/BlockEventSubscriber.php b/src/core/EventSubscriber/Site/Page/BlockEventSubscriber.php index 753f9d0..29198a6 100644 --- a/src/core/EventSubscriber/Site/Page/BlockEventSubscriber.php +++ b/src/core/EventSubscriber/Site/Page/BlockEventSubscriber.php @@ -17,11 +17,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; */ class BlockEventSubscriber extends EntityManagerEventSubscriber { - protected FileUploadHandler $fileUpload; - - public function __construct(FileUploadHandler $fileUpload) + public function __construct(protected FileUploadHandler $fileUpload) { - $this->fileUpload = $fileUpload; } public function supports(EntityInterface $entity): bool diff --git a/src/core/EventSubscriber/Site/Page/PageEventSubscriber.php b/src/core/EventSubscriber/Site/Page/PageEventSubscriber.php index a73ad5a..61268c0 100644 --- a/src/core/EventSubscriber/Site/Page/PageEventSubscriber.php +++ b/src/core/EventSubscriber/Site/Page/PageEventSubscriber.php @@ -16,11 +16,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; */ class PageEventSubscriber extends EntityManagerEventSubscriber { - protected FileUploadHandler $fileUpload; - - public function __construct(FileUploadHandler $fileUpload) + public function __construct(protected FileUploadHandler $fileUpload) { - $this->fileUpload = $fileUpload; } public function supports(EntityInterface $entity): bool diff --git a/src/core/EventSubscriber/Site/SiteEventSubscriber.php b/src/core/EventSubscriber/Site/SiteEventSubscriber.php index e93530e..02bdc01 100644 --- a/src/core/EventSubscriber/Site/SiteEventSubscriber.php +++ b/src/core/EventSubscriber/Site/SiteEventSubscriber.php @@ -18,13 +18,10 @@ use Symfony\Component\HttpKernel\KernelInterface; */ class SiteEventSubscriber extends EntityManagerEventSubscriber { - protected KernelInterface $kernel; - protected SymfonyCacheManager $cacheManager; - - public function __construct(KernelInterface $kernel, SymfonyCacheManager $cacheManager) - { - $this->kernel = $kernel; - $this->cacheManager = $cacheManager; + public function __construct( + protected KernelInterface $kernel, + protected SymfonyCacheManager $cacheManager + ) { } public function supports(EntityInterface $entity): bool diff --git a/src/core/EventSubscriber/Task/CacheCleanTaskEventSubscriber.php b/src/core/EventSubscriber/Task/CacheCleanTaskEventSubscriber.php index f2efbcb..ae5674b 100644 --- a/src/core/EventSubscriber/Task/CacheCleanTaskEventSubscriber.php +++ b/src/core/EventSubscriber/Task/CacheCleanTaskEventSubscriber.php @@ -13,11 +13,8 @@ use App\Core\Event\Task\TaskRunRequestedEvent; */ class CacheCleanTaskEventSubscriber extends TaskEventSubscriber { - protected SymfonyCacheManager $cacheManager; - - public function __construct(SymfonyCacheManager $cacheManager) + public function __construct(protected SymfonyCacheManager $cacheManager) { - $this->cacheManager = $cacheManager; } public function onInit(TaskInitEvent $event) diff --git a/src/core/FileManager/FsFileManager.php b/src/core/FileManager/FsFileManager.php index 38e6e5c..b49eac0 100644 --- a/src/core/FileManager/FsFileManager.php +++ b/src/core/FileManager/FsFileManager.php @@ -23,22 +23,15 @@ class FsFileManager protected string $path; protected string $pathUri; protected array $pathLocked; - protected FileUploadHandler $uploadHandler; - protected FileInformationFactory $fileInformationFactory; - protected FileInformationRepositoryQuery $fileInformationRepositoryQuery; public function __construct( ParameterBagInterface $params, - FileUploadHandler $uploadHandler, - FileInformationFactory $fileInformationFactory, - FileInformationRepositoryQuery $fileInformationRepositoryQuery + protected FileUploadHandler $uploadHandler, + protected FileInformationFactory $fileInformationFactory, + protected FileInformationRepositoryQuery $fileInformationRepositoryQuery ) { $config = $params->get('core')['file_manager']; - $this->uploadHandler = $uploadHandler; - $this->fileInformationFactory = $fileInformationFactory; - $this->fileInformationRepositoryQuery = $fileInformationRepositoryQuery; - $this->mimes = $config['mimes']; $this->path = $config['path']; $this->pathUri = $this->normalizePath($config['path_uri']); diff --git a/src/core/Manager/EntityManager.php b/src/core/Manager/EntityManager.php index c642053..3a7d9e8 100644 --- a/src/core/Manager/EntityManager.php +++ b/src/core/Manager/EntityManager.php @@ -4,7 +4,6 @@ namespace App\Core\Manager; use App\Core\Entity\EntityInterface; use App\Core\Event\EntityManager\EntityManagerEvent; -use Doctrine\ORM\EntityManager as DoctrineEntityManager; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -15,14 +14,10 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; */ class EntityManager { - protected EventDispatcherInterface $eventDispatcher; - - protected DoctrineEntityManager $entityManager; - - public function __construct(EventDispatcherInterface $eventDispatcher, EntityManagerInterface $entityManager) - { - $this->eventDispatcher = $eventDispatcher; - $this->entityManager = $entityManager; + public function __construct( + protected EventDispatcherInterface $eventDispatcher, + protected EntityManagerInterface $entityManager + ) { } public function create(EntityInterface $entity, bool $dispatchEvent = true, bool $flush = true): self diff --git a/src/core/Notification/MailNotifier.php b/src/core/Notification/MailNotifier.php index f788e0b..1e1a637 100644 --- a/src/core/Notification/MailNotifier.php +++ b/src/core/Notification/MailNotifier.php @@ -14,7 +14,6 @@ use Twig\Environment as TwigEnvironment; */ class MailNotifier { - protected MailerInterface $mailer; protected array $attachments = []; protected array $recipients = []; protected array $bccRecipients = []; @@ -22,10 +21,8 @@ class MailNotifier protected ?string $from = null; protected ?string $replyTo = null; - public function __construct(TwigEnvironment $twig, MailerInterface $mailer) + public function __construct(protected TwigEnvironment $twig, protected MailerInterface $mailer) { - $this->mailer = $mailer; - $this->twig = $twig; } public function setMailer(Swift_Mailer $mailer): self diff --git a/src/core/Router/RedirectBuilder.php b/src/core/Router/RedirectBuilder.php index 3ad94db..26aaa47 100644 --- a/src/core/Router/RedirectBuilder.php +++ b/src/core/Router/RedirectBuilder.php @@ -14,11 +14,8 @@ use Symfony\Component\HttpFoundation\Request; */ class RedirectBuilder { - protected UrlBuilder $urlBuilder; - - public function __construct(UrlBuilder $urlBuilder) + public function __construct(protected UrlBuilder $urlBuilder) { - $this->urlBuilder = $urlBuilder; } public function buildResponse(Redirect $redirect, Request $request): RedirectResponse diff --git a/src/core/Router/SiteRouteLoader.php b/src/core/Router/SiteRouteLoader.php index 6452cee..9cfc2be 100644 --- a/src/core/Router/SiteRouteLoader.php +++ b/src/core/Router/SiteRouteLoader.php @@ -15,10 +15,9 @@ use Symfony\Component\Routing\RouteCollection; */ class SiteRouteLoader extends Loader { - protected NavigationRepositoryQuery $navigationQuery; protected $isLoaded = false; - public function __construct(NavigationRepositoryQuery $navigationQuery) + public function __construct(protected NavigationRepositoryQuery $navigationQuery) { $this->navigationQuery = $navigationQuery; } diff --git a/src/core/Setting/NavigationSettingManager.php b/src/core/Setting/NavigationSettingManager.php index cf40b27..91e038f 100644 --- a/src/core/Setting/NavigationSettingManager.php +++ b/src/core/Setting/NavigationSettingManager.php @@ -16,21 +16,12 @@ use App\Core\Repository\Site\NavigationRepositoryQuery; */ class NavigationSettingManager { - protected EntityManager $entityManager; - protected NavigationSettingRepositoryQuery $query; - protected NavigationRepositoryQuery $navigationQuery; - protected NavigationSettingFactory $factory; - public function __construct( - EntityManager $entityManager, - NavigationSettingRepositoryQuery $query, - NavigationRepositoryQuery $navigationQuery, - NavigationSettingFactory $factory + protected EntityManager $entityManager, + protected NavigationSettingRepositoryQuery $query, + protected NavigationRepositoryQuery $navigationQuery, + protected NavigationSettingFactory $factory ) { - $this->entityManager = $entityManager; - $this->query = $query; - $this->navigationQuery = $navigationQuery; - $this->factory = $factory; } public function init($navigation, string $code, string $section, string $label, $value = null) diff --git a/src/core/Setting/SettingManager.php b/src/core/Setting/SettingManager.php index 597a209..da60fee 100644 --- a/src/core/Setting/SettingManager.php +++ b/src/core/Setting/SettingManager.php @@ -14,15 +14,11 @@ use App\Core\Repository\SettingRepositoryQuery; */ class SettingManager { - protected EntityManager $entityManager; - protected SettingRepositoryQuery $query; - protected SettingFactory $factory; - - public function __construct(EntityManager $entityManager, SettingRepositoryQuery $query, SettingFactory $factory) - { - $this->entityManager = $entityManager; - $this->query = $query; - $this->factory = $factory; + public function __construct( + protected EntityManager $entityManager, + protected SettingRepositoryQuery $query, + protected SettingFactory $factory + ) { } public function init(string $code, string $section, string $label, $value = null) diff --git a/src/core/Site/SiteRequest.php b/src/core/Site/SiteRequest.php index e127eeb..8d7d054 100644 --- a/src/core/Site/SiteRequest.php +++ b/src/core/Site/SiteRequest.php @@ -6,9 +6,7 @@ use App\Core\Entity\Site\Menu; use App\Core\Entity\Site\Navigation; use App\Core\Entity\Site\Node; use App\Core\Entity\Site\Page\Page; -use App\Core\Repository\Site\NavigationRepositoryQuery; use App\Core\Repository\Site\NodeRepository; -use App\Core\Repository\Site\Page\PageRepositoryQuery; use Symfony\Component\HttpFoundation\RequestStack; /** @@ -18,15 +16,10 @@ use Symfony\Component\HttpFoundation\RequestStack; */ class SiteRequest { - protected RequestStack $requestStack; - protected NodeRepository $nodeRepository; - protected NavigationRepositoryQuery $navigationRepositoryQuery; - protected PageRepositoryQuery $pageRepositoryQuery; - - public function __construct(RequestStack $requestStack, NodeRepository $nodeRepository) - { - $this->requestStack = $requestStack; - $this->nodeRepository = $nodeRepository; + public function __construct( + protected RequestStack $requestStack, + protected NodeRepository $nodeRepository + ) { } public function getNode(): ?Node diff --git a/src/core/Site/SiteStore.php b/src/core/Site/SiteStore.php index 94229b5..1585d4f 100644 --- a/src/core/Site/SiteStore.php +++ b/src/core/Site/SiteStore.php @@ -13,13 +13,10 @@ use App\Core\Repository\Site\NavigationRepositoryQuery; */ class SiteStore { - protected NavigationRepositoryQuery $navigationRepositoryQuery; - protected SiteRequest $siteRequest; - - public function __construct(NavigationRepositoryQuery $navigationRepositoryQuery, SiteRequest $siteRequest) - { - $this->navigationRepositoryQuery = $navigationRepositoryQuery; - $this->siteRequest = $siteRequest; + public function __construct( + protected NavigationRepositoryQuery $navigationRepositoryQuery, + protected SiteRequest $siteRequest + ) { } public function getNavigations(): array diff --git a/src/core/Sitemap/SitemapBuilder.php b/src/core/Sitemap/SitemapBuilder.php index ab4f43e..9815bc9 100644 --- a/src/core/Sitemap/SitemapBuilder.php +++ b/src/core/Sitemap/SitemapBuilder.php @@ -17,15 +17,11 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; */ class SitemapBuilder { - protected Reader $annotationReader; - protected ContainerInterface $container; - protected UrlGeneratorInterface $urlGenerator; - - public function __construct(Reader $annotationReader, ContainerInterface $container, UrlGeneratorInterface $urlGenerator) - { - $this->annotationReader = $annotationReader; - $this->container = $container; - $this->urlGenerator = $urlGenerator; + public function __construct( + protected Reader $annotationReader, + protected ContainerInterface $container, + protected UrlGeneratorInterface $urlGenerator + ) { } public function build(Navigation $navigation, ?string $currentDomain): array diff --git a/src/core/String/FileInformationBuilder.php b/src/core/String/FileInformationBuilder.php index 9f3aab6..4c3e586 100644 --- a/src/core/String/FileInformationBuilder.php +++ b/src/core/String/FileInformationBuilder.php @@ -2,7 +2,6 @@ namespace App\Core\String; -use App\Core\FileManager\FsFileManager; use App\Core\Repository\FileInformationRepositoryQuery; /** @@ -12,13 +11,9 @@ use App\Core\Repository\FileInformationRepositoryQuery; */ class FileInformationBuilder { - protected FsFileManager $fsManager; - protected FileInformationRepositoryQuery $query; - - public function __construct(FsFileManager $fsManager, FileInformationRepositoryQuery $query) - { - $this->fsManager = $fsManager; - $this->query = $query; + public function __construct( + protected FileInformationRepositoryQuery $query + ) { } public function replaceTags(string $value) diff --git a/src/core/String/UrlBuilder.php b/src/core/String/UrlBuilder.php index 759f187..452d1c4 100644 --- a/src/core/String/UrlBuilder.php +++ b/src/core/String/UrlBuilder.php @@ -12,13 +12,10 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; */ class UrlBuilder { - protected UrlGeneratorInterface $urlGenerator; - protected SiteRequest $siteRequest; - - public function __construct(UrlGeneratorInterface $urlGenerator, SiteRequest $siteRequest) - { - $this->urlGenerator = $urlGenerator; - $this->siteRequest = $siteRequest; + public function __construct( + protected UrlGeneratorInterface $urlGenerator, + protected SiteRequest $siteRequest + ) { } public function replaceTags(string $value): string diff --git a/src/core/Twig/Extension/AbTestExtension.php b/src/core/Twig/Extension/AbTestExtension.php index ac2226b..92c9c66 100644 --- a/src/core/Twig/Extension/AbTestExtension.php +++ b/src/core/Twig/Extension/AbTestExtension.php @@ -9,11 +9,8 @@ use Twig\TwigFunction; class AbTestExtension extends AbstractExtension { - protected AbContainer $container; - - public function __construct(AbContainer $container) + public function __construct(protected AbContainer $container) { - $this->container = $container; } public function getFunctions(): array diff --git a/src/core/Twig/Extension/CrudExtension.php b/src/core/Twig/Extension/CrudExtension.php index eb2c015..b481440 100644 --- a/src/core/Twig/Extension/CrudExtension.php +++ b/src/core/Twig/Extension/CrudExtension.php @@ -12,15 +12,12 @@ use Twig\TwigFunction; class CrudExtension extends AbstractExtension { protected PropertyAccessor $propertyAccessor; - protected Environment $twig; - public function __construct(Environment $twig) + public function __construct(protected Environment $twig) { $this->propertyAccessor = PropertyAccess::createPropertyAccessorBuilder() ->getPropertyAccessor() ; - - $this->twig = $twig; } /** diff --git a/src/core/Twig/Extension/EditorJsExtension.php b/src/core/Twig/Extension/EditorJsExtension.php index 9259f48..a320447 100644 --- a/src/core/Twig/Extension/EditorJsExtension.php +++ b/src/core/Twig/Extension/EditorJsExtension.php @@ -9,7 +9,6 @@ use Twig\TwigFilter; class EditorJsExtension extends AbstractExtension { - protected Environment $twig; protected array $views = []; protected array $defaultAllowedBlocks = [ 'paragraph', @@ -27,9 +26,8 @@ class EditorJsExtension extends AbstractExtension 'link', ]; - public function __construct(Environment $twig, ParameterBagInterface $params) + public function __construct(protected Environment $twig, ParameterBagInterface $params) { - $this->twig = $twig; $blocks = $params->get('core')['editor_js']['blocks'] ?? []; foreach ($blocks as $block => $view) { diff --git a/src/core/Twig/Extension/EntityExtension.php b/src/core/Twig/Extension/EntityExtension.php index 92152f7..2ef09d6 100644 --- a/src/core/Twig/Extension/EntityExtension.php +++ b/src/core/Twig/Extension/EntityExtension.php @@ -14,9 +14,8 @@ class EntityExtension extends AbstractExtension { protected PropertyAccessor $propertyAccessor; - public function __construct(EntityManagerInterface $entityManager) + public function __construct(protected EntityManagerInterface $entityManager) { - $this->entityManager = $entityManager; $this->propertyAccessor = PropertyAccess::createPropertyAccessorBuilder() ->disableExceptionOnInvalidPropertyPath() ->getPropertyAccessor() diff --git a/src/core/Twig/Extension/FileInformationExtension.php b/src/core/Twig/Extension/FileInformationExtension.php index a97f126..16688e2 100644 --- a/src/core/Twig/Extension/FileInformationExtension.php +++ b/src/core/Twig/Extension/FileInformationExtension.php @@ -11,16 +11,11 @@ use Twig\TwigFilter; class FileInformationExtension extends AbstractExtension { - protected FileInformationBuilder $fileInfoBuilder; - public function __construct( - FileInformationBuilder $fileInfoBuilder, - FsFileManager $fsManager, - FileInformationRepositoryQuery $query + protected FileInformationBuilder $fileInfoBuilder, + protected FsFileManager $fsManager, + protected FileInformationRepositoryQuery $query ) { - $this->fileInfoBuilder = $fileInfoBuilder; - $this->fsManager = $fsManager; - $this->query = $query; } /** diff --git a/src/core/Twig/Extension/RoutingExtension.php b/src/core/Twig/Extension/RoutingExtension.php index daccaa0..8608f2e 100644 --- a/src/core/Twig/Extension/RoutingExtension.php +++ b/src/core/Twig/Extension/RoutingExtension.php @@ -14,13 +14,10 @@ use Twig\TwigFunction; class RoutingExtension extends AbstractExtension { - protected UrlGeneratorInterface $generator; - protected SiteRequest $siteRequest; - - public function __construct(UrlGeneratorInterface $generator, SiteRequest $siteRequest) - { - $this->generator = $generator; - $this->siteRequest = $siteRequest; + public function __construct( + protected UrlGeneratorInterface $generator, + protected SiteRequest $siteRequest + ) { } /** diff --git a/src/core/Twig/Extension/SettingExtension.php b/src/core/Twig/Extension/SettingExtension.php index dbe7e52..d0e7c50 100644 --- a/src/core/Twig/Extension/SettingExtension.php +++ b/src/core/Twig/Extension/SettingExtension.php @@ -9,13 +9,10 @@ use Twig\TwigFunction; class SettingExtension extends AbstractExtension { - private SettingManager $settingManager; - private NavigationSettingManager $navigationSettingManager; - - public function __construct(SettingManager $settingManager, NavigationSettingManager $navigationSettingManager) - { - $this->settingManager = $settingManager; - $this->navigationSettingManager = $navigationSettingManager; + public function __construct( + protected SettingManager $settingManager, + protected NavigationSettingManager $navigationSettingManager + ) { } /** diff --git a/src/core/Twig/Extension/StringExtension.php b/src/core/Twig/Extension/StringExtension.php index c7f5c13..0418199 100644 --- a/src/core/Twig/Extension/StringExtension.php +++ b/src/core/Twig/Extension/StringExtension.php @@ -8,11 +8,8 @@ use Twig\TwigFilter; class StringExtension extends AbstractExtension { - protected StringBuilder $stringBuilder; - - public function __construct(StringBuilder $stringBuilder) + public function __construct(protected StringBuilder $stringBuilder) { - $this->stringBuilder = $stringBuilder; } /** diff --git a/src/core/Twig/Extension/UrlExtension.php b/src/core/Twig/Extension/UrlExtension.php index 0f75046..528462f 100644 --- a/src/core/Twig/Extension/UrlExtension.php +++ b/src/core/Twig/Extension/UrlExtension.php @@ -8,11 +8,8 @@ use Twig\TwigFilter; class UrlExtension extends AbstractExtension { - protected UrlBuilder $urlBuilder; - - public function __construct(UrlBuilder $urlBuilder) + public function __construct(protected UrlBuilder $urlBuilder) { - $this->urlBuilder = $urlBuilder; } /**