diff --git a/module/CLI/src/Input/EndDateOption.php b/module/CLI/src/Input/EndDateOption.php index f2073397..a38b9b32 100644 --- a/module/CLI/src/Input/EndDateOption.php +++ b/module/CLI/src/Input/EndDateOption.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface; use function sprintf; -readonly final class EndDateOption +final readonly class EndDateOption { private DateOption $dateOption; diff --git a/module/CLI/src/Input/ShortUrlDataInput.php b/module/CLI/src/Input/ShortUrlDataInput.php index 2d3bf91e..1ff1de3f 100644 --- a/module/CLI/src/Input/ShortUrlDataInput.php +++ b/module/CLI/src/Input/ShortUrlDataInput.php @@ -18,7 +18,7 @@ use function array_unique; use function Shlinkio\Shlink\Core\ArrayUtils\flatten; use function Shlinkio\Shlink\Core\splitByComma; -readonly final class ShortUrlDataInput +final readonly class ShortUrlDataInput { public function __construct(Command $command, private bool $longUrlAsOption = false) { diff --git a/module/CLI/src/Input/ShortUrlIdentifierInput.php b/module/CLI/src/Input/ShortUrlIdentifierInput.php index def03f74..46ac79da 100644 --- a/module/CLI/src/Input/ShortUrlIdentifierInput.php +++ b/module/CLI/src/Input/ShortUrlIdentifierInput.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; -readonly final class ShortUrlIdentifierInput +final readonly class ShortUrlIdentifierInput { public function __construct(Command $command, string $shortCodeDesc, string $domainDesc) { diff --git a/module/CLI/src/Input/StartDateOption.php b/module/CLI/src/Input/StartDateOption.php index eaef301f..453b31a2 100644 --- a/module/CLI/src/Input/StartDateOption.php +++ b/module/CLI/src/Input/StartDateOption.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface; use function sprintf; -readonly final class StartDateOption +final readonly class StartDateOption { private DateOption $dateOption; diff --git a/module/Core/src/Crawling/CrawlingHelper.php b/module/Core/src/Crawling/CrawlingHelper.php index 958cb96e..12c0e546 100644 --- a/module/Core/src/Crawling/CrawlingHelper.php +++ b/module/Core/src/Crawling/CrawlingHelper.php @@ -6,9 +6,9 @@ namespace Shlinkio\Shlink\Core\Crawling; use Shlinkio\Shlink\Core\ShortUrl\Repository\CrawlableShortCodesQueryInterface; -class CrawlingHelper implements CrawlingHelperInterface +readonly class CrawlingHelper implements CrawlingHelperInterface { - public function __construct(private readonly CrawlableShortCodesQueryInterface $query) + public function __construct(private CrawlableShortCodesQueryInterface $query) { } diff --git a/module/Core/src/Domain/Model/DomainItem.php b/module/Core/src/Domain/Model/DomainItem.php index 53f2b6f7..6352e924 100644 --- a/module/Core/src/Domain/Model/DomainItem.php +++ b/module/Core/src/Domain/Model/DomainItem.php @@ -9,12 +9,12 @@ use Shlinkio\Shlink\Core\Config\NotFoundRedirectConfigInterface; use Shlinkio\Shlink\Core\Config\NotFoundRedirects; use Shlinkio\Shlink\Core\Domain\Entity\Domain; -final class DomainItem implements JsonSerializable +final readonly class DomainItem implements JsonSerializable { private function __construct( - private readonly string $authority, - public readonly NotFoundRedirectConfigInterface $notFoundRedirectConfig, - public readonly bool $isDefault, + private string $authority, + public NotFoundRedirectConfigInterface $notFoundRedirectConfig, + public bool $isDefault, ) { } diff --git a/module/Core/src/ErrorHandler/Model/NotFoundType.php b/module/Core/src/ErrorHandler/Model/NotFoundType.php index de0c5460..99f71f8b 100644 --- a/module/Core/src/ErrorHandler/Model/NotFoundType.php +++ b/module/Core/src/ErrorHandler/Model/NotFoundType.php @@ -11,9 +11,9 @@ use Shlinkio\Shlink\Core\Visit\Model\VisitType; use function rtrim; -class NotFoundType +readonly class NotFoundType { - private function __construct(private readonly VisitType|null $type) + private function __construct(private VisitType|null $type) { } diff --git a/module/Core/src/EventDispatcher/LocateUnlocatedVisits.php b/module/Core/src/EventDispatcher/LocateUnlocatedVisits.php index 1a51e949..3c60515b 100644 --- a/module/Core/src/EventDispatcher/LocateUnlocatedVisits.php +++ b/module/Core/src/EventDispatcher/LocateUnlocatedVisits.php @@ -13,11 +13,11 @@ use Shlinkio\Shlink\Core\Visit\Geolocation\VisitLocatorInterface; use Shlinkio\Shlink\Core\Visit\Geolocation\VisitToLocationHelperInterface; use Shlinkio\Shlink\IpGeolocation\Model\Location; -class LocateUnlocatedVisits implements VisitGeolocationHelperInterface +readonly class LocateUnlocatedVisits implements VisitGeolocationHelperInterface { public function __construct( - private readonly VisitLocatorInterface $locator, - private readonly VisitToLocationHelperInterface $visitToLocation, + private VisitLocatorInterface $locator, + private VisitToLocationHelperInterface $visitToLocation, ) { } diff --git a/module/Core/src/EventDispatcher/UpdateGeoLiteDb.php b/module/Core/src/EventDispatcher/UpdateGeoLiteDb.php index f19378ea..4e4720c5 100644 --- a/module/Core/src/EventDispatcher/UpdateGeoLiteDb.php +++ b/module/Core/src/EventDispatcher/UpdateGeoLiteDb.php @@ -13,12 +13,12 @@ use Throwable; use function sprintf; -class UpdateGeoLiteDb +readonly class UpdateGeoLiteDb { public function __construct( - private readonly GeolocationDbUpdaterInterface $dbUpdater, - private readonly LoggerInterface $logger, - private readonly EventDispatcherInterface $eventDispatcher, + private GeolocationDbUpdaterInterface $dbUpdater, + private LoggerInterface $logger, + private EventDispatcherInterface $eventDispatcher, ) { } diff --git a/module/Core/src/ShortUrl/Middleware/ExtraPathRedirectMiddleware.php b/module/Core/src/ShortUrl/Middleware/ExtraPathRedirectMiddleware.php index 7c868907..4a02f6e9 100644 --- a/module/Core/src/ShortUrl/Middleware/ExtraPathRedirectMiddleware.php +++ b/module/Core/src/ShortUrl/Middleware/ExtraPathRedirectMiddleware.php @@ -25,14 +25,14 @@ use function implode; use function sprintf; use function trim; -class ExtraPathRedirectMiddleware implements MiddlewareInterface +readonly class ExtraPathRedirectMiddleware implements MiddlewareInterface { public function __construct( - private readonly ShortUrlResolverInterface $resolver, - private readonly RequestTrackerInterface $requestTracker, - private readonly ShortUrlRedirectionBuilderInterface $redirectionBuilder, - private readonly RedirectResponseHelperInterface $redirectResponseHelper, - private readonly UrlShortenerOptions $urlShortenerOptions, + private ShortUrlResolverInterface $resolver, + private RequestTrackerInterface $requestTracker, + private ShortUrlRedirectionBuilderInterface $redirectionBuilder, + private RedirectResponseHelperInterface $redirectResponseHelper, + private UrlShortenerOptions $urlShortenerOptions, ) { } diff --git a/module/Core/src/ShortUrl/Model/UrlShorteningResult.php b/module/Core/src/ShortUrl/Model/UrlShorteningResult.php index 6bfd91bc..a710b63a 100644 --- a/module/Core/src/ShortUrl/Model/UrlShorteningResult.php +++ b/module/Core/src/ShortUrl/Model/UrlShorteningResult.php @@ -7,11 +7,11 @@ namespace Shlinkio\Shlink\Core\ShortUrl\Model; use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl; use Throwable; -final class UrlShorteningResult +final readonly class UrlShorteningResult { private function __construct( - public readonly ShortUrl $shortUrl, - private readonly Throwable|null $errorOnEventDispatching, + public ShortUrl $shortUrl, + private Throwable|null $errorOnEventDispatching, ) { } diff --git a/module/Core/src/ShortUrl/ShortUrlVisitsDeleter.php b/module/Core/src/ShortUrl/ShortUrlVisitsDeleter.php index e8a07654..eec122a2 100644 --- a/module/Core/src/ShortUrl/ShortUrlVisitsDeleter.php +++ b/module/Core/src/ShortUrl/ShortUrlVisitsDeleter.php @@ -10,11 +10,11 @@ use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier; use Shlinkio\Shlink\Core\Visit\Repository\VisitDeleterRepositoryInterface; use Shlinkio\Shlink\Rest\Entity\ApiKey; -class ShortUrlVisitsDeleter implements ShortUrlVisitsDeleterInterface +readonly class ShortUrlVisitsDeleter implements ShortUrlVisitsDeleterInterface { public function __construct( - private readonly VisitDeleterRepositoryInterface $repository, - private readonly ShortUrlResolverInterface $resolver, + private VisitDeleterRepositoryInterface $repository, + private ShortUrlResolverInterface $resolver, ) { } diff --git a/module/Core/src/Util/RedirectResponseHelper.php b/module/Core/src/Util/RedirectResponseHelper.php index edb04b8e..4c4fdd21 100644 --- a/module/Core/src/Util/RedirectResponseHelper.php +++ b/module/Core/src/Util/RedirectResponseHelper.php @@ -10,9 +10,9 @@ use Shlinkio\Shlink\Core\Config\Options\RedirectOptions; use function sprintf; -class RedirectResponseHelper implements RedirectResponseHelperInterface +readonly class RedirectResponseHelper implements RedirectResponseHelperInterface { - public function __construct(private readonly RedirectOptions $options) + public function __construct(private RedirectOptions $options) { } diff --git a/module/Core/src/Visit/Geolocation/VisitLocator.php b/module/Core/src/Visit/Geolocation/VisitLocator.php index 63cb6137..f3aba193 100644 --- a/module/Core/src/Visit/Geolocation/VisitLocator.php +++ b/module/Core/src/Visit/Geolocation/VisitLocator.php @@ -11,11 +11,11 @@ use Shlinkio\Shlink\Core\Visit\Entity\VisitLocation; use Shlinkio\Shlink\Core\Visit\Repository\VisitIterationRepositoryInterface; use Shlinkio\Shlink\IpGeolocation\Model\Location; -class VisitLocator implements VisitLocatorInterface +readonly class VisitLocator implements VisitLocatorInterface { public function __construct( - private readonly EntityManagerInterface $em, - private readonly VisitIterationRepositoryInterface $repo, + private EntityManagerInterface $em, + private VisitIterationRepositoryInterface $repo, ) { } diff --git a/module/Core/src/Visit/Geolocation/VisitToLocationHelper.php b/module/Core/src/Visit/Geolocation/VisitToLocationHelper.php index 9d614a7b..b444e592 100644 --- a/module/Core/src/Visit/Geolocation/VisitToLocationHelper.php +++ b/module/Core/src/Visit/Geolocation/VisitToLocationHelper.php @@ -11,9 +11,9 @@ use Shlinkio\Shlink\IpGeolocation\Exception\WrongIpException; use Shlinkio\Shlink\IpGeolocation\Model\Location; use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface; -class VisitToLocationHelper implements VisitToLocationHelperInterface +readonly class VisitToLocationHelper implements VisitToLocationHelperInterface { - public function __construct(private readonly IpLocationResolverInterface $ipLocationResolver) + public function __construct(private IpLocationResolverInterface $ipLocationResolver) { } diff --git a/module/Core/src/Visit/VisitsDeleter.php b/module/Core/src/Visit/VisitsDeleter.php index fb0f231a..42ca0ffa 100644 --- a/module/Core/src/Visit/VisitsDeleter.php +++ b/module/Core/src/Visit/VisitsDeleter.php @@ -9,9 +9,9 @@ use Shlinkio\Shlink\Core\Visit\Repository\VisitDeleterRepositoryInterface; use Shlinkio\Shlink\Rest\ApiKey\Role; use Shlinkio\Shlink\Rest\Entity\ApiKey; -class VisitsDeleter implements VisitsDeleterInterface +readonly class VisitsDeleter implements VisitsDeleterInterface { - public function __construct(private readonly VisitDeleterRepositoryInterface $repository) + public function __construct(private VisitDeleterRepositoryInterface $repository) { }