Added nullsafe operator to simplify conditions

This commit is contained in:
Alejandro Celaya
2021-05-23 12:31:10 +02:00
parent e0f0bb5523
commit c01121d61a
64 changed files with 95 additions and 113 deletions

View File

@@ -49,9 +49,9 @@ class VisitsStatsHelper implements VisitsStatsHelperInterface
public function visitsForShortUrl(
ShortUrlIdentifier $identifier,
VisitsParams $params,
?ApiKey $apiKey = null
?ApiKey $apiKey = null,
): Paginator {
$spec = $apiKey !== null ? $apiKey->spec() : null;
$spec = $apiKey?->spec();
/** @var ShortUrlRepositoryInterface $repo */
$repo = $this->em->getRepository(ShortUrl::class);