diff --git a/src/Handler/Lol.php b/src/Handler/Lol.php index 3a87921..a9dc7ae 100644 --- a/src/Handler/Lol.php +++ b/src/Handler/Lol.php @@ -7,10 +7,10 @@ use Lubian\AttributeMagic\Infrastructure\Route\AsHandler; use Lubian\AttributeMagic\Infrastructure\Route\HttpMethod; use Lubian\AttributeMagic\Listener\LauschEvent; -final class Lol +final readonly class Lol { public function __construct( - private readonly Dispatcher $dispatcher, + private Dispatcher $dispatcher, ) { } diff --git a/src/Infrastructure/Event/AsListener.php b/src/Infrastructure/Event/AsListener.php index 4143478..ea300ea 100644 --- a/src/Infrastructure/Event/AsListener.php +++ b/src/Infrastructure/Event/AsListener.php @@ -4,16 +4,15 @@ namespace Lubian\AttributeMagic\Infrastructure\Event; use Attribute; -#[Attribute(Attribute::TARGET_METHOD)] -final class AsListener +#[Attribute(Attribute::TARGET_METHOD)]final readonly class AsListener { /** * @param class-string $eventClass * @param int<-100, 100> $priority */ public function __construct( - public readonly string $eventClass, - public readonly int $priority = 0, + public string $eventClass, + public int $priority = 0, ) { } } diff --git a/src/Infrastructure/Event/DispatcherFactory.php b/src/Infrastructure/Event/DispatcherFactory.php index 195a47c..3dcac19 100644 --- a/src/Infrastructure/Event/DispatcherFactory.php +++ b/src/Infrastructure/Event/DispatcherFactory.php @@ -11,13 +11,13 @@ use function file_put_contents; use function serialize; use function unserialize; -final class DispatcherFactory +final readonly class DispatcherFactory { public const CACHE_FILE = __DIR__ . '/../../../var/listenerCache'; public function __construct( - private readonly Finder $finder, - private readonly InvokerInterface $invoker + private Finder $finder, + private InvokerInterface $invoker ) { } diff --git a/src/Infrastructure/Event/Listener.php b/src/Infrastructure/Event/Listener.php index 24c2e3e..077fd62 100644 --- a/src/Infrastructure/Event/Listener.php +++ b/src/Infrastructure/Event/Listener.php @@ -2,7 +2,7 @@ namespace Lubian\AttributeMagic\Infrastructure\Event; -final class Listener +final readonly class Listener { /** * @param class-string $eventClass @@ -11,10 +11,10 @@ final class Listener * @param non-empty-string $listenerMethod */ public function __construct( - public readonly string $eventClass, - public readonly int $priority, - public readonly string $listenerClass, - public readonly string $listenerMethod, + public string $eventClass, + public int $priority, + public string $listenerClass, + public string $listenerMethod, ) { } } diff --git a/src/Infrastructure/Route/AsHandler.php b/src/Infrastructure/Route/AsHandler.php index 7a417ca..66fe3d3 100644 --- a/src/Infrastructure/Route/AsHandler.php +++ b/src/Infrastructure/Route/AsHandler.php @@ -4,15 +4,14 @@ namespace Lubian\AttributeMagic\Infrastructure\Route; use Attribute; -#[Attribute(Attribute::TARGET_METHOD)] -final class AsHandler +#[Attribute(Attribute::TARGET_METHOD)]final readonly class AsHandler { /** * @param non-empty-string $path */ public function __construct( - public readonly HttpMethod $method, - public readonly string $path, + public HttpMethod $method, + public string $path, ) { } } diff --git a/src/Infrastructure/Route/Handler.php b/src/Infrastructure/Route/Handler.php index 58a6d11..c14604a 100644 --- a/src/Infrastructure/Route/Handler.php +++ b/src/Infrastructure/Route/Handler.php @@ -2,17 +2,17 @@ namespace Lubian\AttributeMagic\Infrastructure\Route; -final class Handler +final readonly class Handler { /** * @param non-empty-string $handlerClass * @param non-empty-string $handlerMethod */ public function __construct( - public readonly HttpMethod $method, - public readonly string $path, - public readonly string $handlerClass, - public readonly string $handlerMethod, + public HttpMethod $method, + public string $path, + public string $handlerClass, + public string $handlerMethod, ) { } } diff --git a/src/Infrastructure/WebApp/Route/AttributeRouteCollector.php b/src/Infrastructure/WebApp/Route/AttributeRouteCollector.php index 129b09f..fd6d6f2 100644 --- a/src/Infrastructure/WebApp/Route/AttributeRouteCollector.php +++ b/src/Infrastructure/WebApp/Route/AttributeRouteCollector.php @@ -5,10 +5,10 @@ namespace Lubian\AttributeMagic\Infrastructure\WebApp\Route; use Lubian\AttributeMagic\Infrastructure\Event\AsListener; use Lubian\AttributeMagic\Infrastructure\Finder; -final class AttributeRouteCollector +final readonly class AttributeRouteCollector { public function __construct( - private readonly Finder $finder + private Finder $finder ) { } diff --git a/src/Infrastructure/WebApp/Route/HandlerCaller.php b/src/Infrastructure/WebApp/Route/HandlerCaller.php index 4c98437..11abbf5 100644 --- a/src/Infrastructure/WebApp/Route/HandlerCaller.php +++ b/src/Infrastructure/WebApp/Route/HandlerCaller.php @@ -10,10 +10,10 @@ use Symfony\Component\HttpFoundation\Response; use function ob_get_clean; use function ob_start; -final class HandlerCaller +final readonly class HandlerCaller { public function __construct( - private readonly InvokerInterface $invoker + private InvokerInterface $invoker ) { } diff --git a/src/Infrastructure/WebApp/Route/HandlerResolver.php b/src/Infrastructure/WebApp/Route/HandlerResolver.php index d42c64a..7df5c40 100644 --- a/src/Infrastructure/WebApp/Route/HandlerResolver.php +++ b/src/Infrastructure/WebApp/Route/HandlerResolver.php @@ -12,11 +12,11 @@ use Symfony\Component\HttpFoundation\Response; use function FastRoute\cachedDispatcher; -final class HandlerResolver +final readonly class HandlerResolver { public function __construct( - private readonly Dispatcher $dispatcher, - private readonly bool $cached = false, + private Dispatcher $dispatcher, + private bool $cached = false, ) { }