Updated to readonly public props on as many models as possible

This commit is contained in:
Alejandro Celaya
2022-04-23 14:00:47 +02:00
parent e79391907a
commit bca3e62ced
74 changed files with 249 additions and 494 deletions

View File

@@ -20,8 +20,8 @@ class DeleteShortUrlException extends DomainException implements ProblemDetailsE
public static function fromVisitsThreshold(int $threshold, ShortUrlIdentifier $identifier): self
{
$shortCode = $identifier->shortCode();
$domain = $identifier->domain();
$shortCode = $identifier->shortCode;
$domain = $identifier->domain;
$suffix = $domain === null ? '' : sprintf(' for domain "%s"', $domain);
$e = new self(sprintf(
'Impossible to delete short URL with short code "%s"%s, since it has more than "%s" visits.',

View File

@@ -20,8 +20,8 @@ class ShortUrlNotFoundException extends DomainException implements ProblemDetail
public static function fromNotFound(ShortUrlIdentifier $identifier): self
{
$shortCode = $identifier->shortCode();
$domain = $identifier->domain();
$shortCode = $identifier->shortCode;
$domain = $identifier->domain;
$suffix = $domain === null ? '' : sprintf(' for domain "%s"', $domain);
$e = new self(sprintf('No URL found with short code "%s"%s', $shortCode, $suffix));