mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
Make classes readonly when possible
This commit is contained in:
@@ -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,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user