Fixed more coding styles

This commit is contained in:
Alejandro Celaya 2022-12-11 13:11:43 +01:00
parent 931bdb0cd7
commit 0d7a0ee9ea

View file

@ -24,6 +24,7 @@ use Shlinkio\Shlink\Importer\Model\ImportedShlinkUrl;
use function array_column;
use function count;
use function Functional\contains;
use function sprintf;
class ShortUrlRepository extends EntitySpecificationRepository implements ShortUrlRepositoryInterface
{
@ -136,10 +137,12 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU
}
if ($filtering->excludeMaxVisitsReached) {
$visitEntity = Visit::class;
$qb->andWhere($qb->expr()->orX(
$qb->expr()->isNull('s.maxVisits'),
$qb->expr()->gt('s.maxVisits', "(SELECT COUNT(innerV.id) FROM $visitEntity as innerV WHERE innerV.shortUrl=s)"),
$qb->expr()->gt(
's.maxVisits',
sprintf('(SELECT COUNT(innerV.id) FROM %s as innerV WHERE innerV.shortUrl=s)', Visit::class),
),
));
}