diff --git a/composer.json b/composer.json index 8d82756f..3e35cc4f 100644 --- a/composer.json +++ b/composer.json @@ -19,10 +19,10 @@ "ext-pdo": "*", "akrabat/ip-address-middleware": "^2.6", "cakephp/chronos": "^3.1", - "doctrine/dbal": "^4.3", + "doctrine/dbal": "^4.4", "doctrine/migrations": "^3.9", - "doctrine/orm": "^3.5", - "donatj/phpuseragentparser": "^1.10", + "doctrine/orm": "^3.6", + "donatj/phpuseragentparser": "^1.11", "friendsofphp/proxy-manager-lts": "^1.0", "geoip2/geoip2": "^3.1", "guzzlehttp/guzzle": "^7.9", diff --git a/module/Core/src/RedirectRule/ShortUrlRedirectRuleService.php b/module/Core/src/RedirectRule/ShortUrlRedirectRuleService.php index dac0dc61..2366dbaa 100644 --- a/module/Core/src/RedirectRule/ShortUrlRedirectRuleService.php +++ b/module/Core/src/RedirectRule/ShortUrlRedirectRuleService.php @@ -19,9 +19,7 @@ readonly class ShortUrlRedirectRuleService implements ShortUrlRedirectRuleServic { } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function rulesForShortUrl(ShortUrl $shortUrl): array { return $this->em->getRepository(ShortUrlRedirectRule::class)->findBy( @@ -30,9 +28,7 @@ readonly class ShortUrlRedirectRuleService implements ShortUrlRedirectRuleServic ); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function setRulesForShortUrl(ShortUrl $shortUrl, RedirectRulesData $data): array { $rules = []; @@ -54,9 +50,7 @@ readonly class ShortUrlRedirectRuleService implements ShortUrlRedirectRuleServic return $rules; } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function saveRulesForShortUrl(ShortUrl $shortUrl, array $rules): void { $normalizedAndDetachedRules = map($rules, function (ShortUrlRedirectRule $rule, int|string|float $priority) { diff --git a/module/Core/src/ShortUrl/Persistence/ShortUrlsListFiltering.php b/module/Core/src/ShortUrl/Persistence/ShortUrlsListFiltering.php index f9350389..cbf300f6 100644 --- a/module/Core/src/ShortUrl/Persistence/ShortUrlsListFiltering.php +++ b/module/Core/src/ShortUrl/Persistence/ShortUrlsListFiltering.php @@ -12,9 +12,7 @@ use Shlinkio\Shlink\Rest\Entity\ApiKey; class ShortUrlsListFiltering extends ShortUrlsCountFiltering { - /** - * @inheritDoc - */ + /** @inheritDoc */ public function __construct( public readonly int|null $limit = null, public readonly int|null $offset = null, diff --git a/module/Core/src/ShortUrl/Repository/ExpiredShortUrlsRepository.php b/module/Core/src/ShortUrl/Repository/ExpiredShortUrlsRepository.php index 05944f29..62b37cd5 100644 --- a/module/Core/src/ShortUrl/Repository/ExpiredShortUrlsRepository.php +++ b/module/Core/src/ShortUrl/Repository/ExpiredShortUrlsRepository.php @@ -16,9 +16,7 @@ use function sprintf; /** @extends EntitySpecificationRepository */ class ExpiredShortUrlsRepository extends EntitySpecificationRepository implements ExpiredShortUrlsRepositoryInterface { - /** - * @inheritDoc - */ + /** @inheritDoc */ public function delete(ExpiredShortUrlsConditions $conditions): int { $qb = $this->getEntityManager()->createQueryBuilder(); @@ -27,9 +25,7 @@ class ExpiredShortUrlsRepository extends EntitySpecificationRepository implement return $this->applyConditions($qb, $conditions, fn () => (int) $qb->getQuery()->execute()); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function dryCount(ExpiredShortUrlsConditions $conditions): int { $qb = $this->getEntityManager()->createQueryBuilder(); diff --git a/module/Core/src/ShortUrl/ShortUrlListService.php b/module/Core/src/ShortUrl/ShortUrlListService.php index 2a1adb26..cc96e1ca 100644 --- a/module/Core/src/ShortUrl/ShortUrlListService.php +++ b/module/Core/src/ShortUrl/ShortUrlListService.php @@ -19,9 +19,7 @@ readonly class ShortUrlListService implements ShortUrlListServiceInterface ) { } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function listShortUrls(ShortUrlsParams $params, ApiKey|null $apiKey = null): Paginator { $defaultDomain = $this->urlShortenerOptions->defaultDomain; diff --git a/module/Core/src/Tag/TagService.php b/module/Core/src/Tag/TagService.php index a2cbcf2c..f10fbe99 100644 --- a/module/Core/src/Tag/TagService.php +++ b/module/Core/src/Tag/TagService.php @@ -24,17 +24,13 @@ readonly class TagService implements TagServiceInterface { } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function listTags(TagsParams $params, ApiKey|null $apiKey = null): Paginator { return $this->createPaginator(new TagsPaginatorAdapter($this->repo, $params, $apiKey), $params); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function tagsInfo(TagsParams $params, ApiKey|null $apiKey = null): Paginator { return $this->createPaginator(new TagsInfoPaginatorAdapter($this->repo, $params, $apiKey), $params); @@ -54,9 +50,7 @@ readonly class TagService implements TagServiceInterface return $paginator; } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function deleteTags(array $tagNames, ApiKey|null $apiKey = null): void { if (ApiKey::isShortUrlRestricted($apiKey)) { @@ -66,9 +60,7 @@ readonly class TagService implements TagServiceInterface $this->repo->deleteByName($tagNames); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function renameTag(Renaming $renaming, ApiKey|null $apiKey = null): Tag { if (ApiKey::isShortUrlRestricted($apiKey)) { diff --git a/module/Core/src/Visit/VisitsStatsHelper.php b/module/Core/src/Visit/VisitsStatsHelper.php index b9721f3c..d1f6c089 100644 --- a/module/Core/src/Visit/VisitsStatsHelper.php +++ b/module/Core/src/Visit/VisitsStatsHelper.php @@ -64,9 +64,7 @@ readonly class VisitsStatsHelper implements VisitsStatsHelperInterface ); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function visitsForShortUrl( ShortUrlIdentifier $identifier, VisitsParams $params, @@ -87,9 +85,7 @@ readonly class VisitsStatsHelper implements VisitsStatsHelperInterface ); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function visitsForTag(string $tag, WithDomainVisitsParams $params, ApiKey|null $apiKey = null): Paginator { /** @var TagRepository $tagRepo */ @@ -104,9 +100,7 @@ readonly class VisitsStatsHelper implements VisitsStatsHelperInterface return $this->createPaginator(new TagVisitsPaginatorAdapter($repo, $tag, $params, $apiKey), $params); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function visitsForDomain(string $domain, VisitsParams $params, ApiKey|null $apiKey = null): Paginator { /** @var DomainRepository $domainRepo */ @@ -121,9 +115,7 @@ readonly class VisitsStatsHelper implements VisitsStatsHelperInterface return $this->createPaginator(new DomainVisitsPaginatorAdapter($repo, $domain, $params, $apiKey), $params); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function orphanVisits(OrphanVisitsParams $params, ApiKey|null $apiKey = null): Paginator { /** @var VisitRepository $repo */ diff --git a/module/Rest/src/ApiKey/Repository/ApiKeyRepository.php b/module/Rest/src/ApiKey/Repository/ApiKeyRepository.php index 8a6bc59d..1cfd39b3 100644 --- a/module/Rest/src/ApiKey/Repository/ApiKeyRepository.php +++ b/module/Rest/src/ApiKey/Repository/ApiKeyRepository.php @@ -15,9 +15,7 @@ use Shlinkio\Shlink\Rest\Entity\ApiKey; */ class ApiKeyRepository extends EntitySpecificationRepository implements ApiKeyRepositoryInterface { - /** - * @inheritDoc - */ + /** @inheritDoc */ public function createInitialApiKey(string $apiKey): ApiKey|null { $em = $this->getEntityManager(); @@ -42,14 +40,13 @@ class ApiKeyRepository extends EntitySpecificationRepository implements ApiKeyRe }); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function nameExists(string $name): bool { $qb = $this->getEntityManager()->createQueryBuilder(); $qb->select('a.id') - ->from(ApiKey::class, 'a'); + ->from(ApiKey::class, 'a') + ->setMaxResults(1); $this->queryBuilderByName($qb, $name); @@ -60,9 +57,7 @@ class ApiKeyRepository extends EntitySpecificationRepository implements ApiKeyRe return $query->getOneOrNullResult() !== null; } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function deleteByName(string $name): int { $qb = $this->getEntityManager()->createQueryBuilder(); @@ -79,7 +74,6 @@ class ApiKeyRepository extends EntitySpecificationRepository implements ApiKeyRe private function queryBuilderByName(QueryBuilder $qb, string $name): void { $qb->where($qb->expr()->eq('a.name', ':name')) - ->setParameter('name', $name) - ->setMaxResults(1); + ->setParameter('name', $name); } } diff --git a/module/Rest/src/Service/ApiKeyService.php b/module/Rest/src/Service/ApiKeyService.php index d717126d..0da23f9e 100644 --- a/module/Rest/src/Service/ApiKeyService.php +++ b/module/Rest/src/Service/ApiKeyService.php @@ -21,9 +21,7 @@ readonly class ApiKeyService implements ApiKeyServiceInterface { } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function create(ApiKeyMeta $apiKeyMeta): ApiKey { return $this->em->wrapInTransaction(function () use ($apiKeyMeta) { @@ -68,9 +66,7 @@ readonly class ApiKeyService implements ApiKeyServiceInterface return new ApiKeyCheckResult($apiKey); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function deleteByName(string $apiKeyName): void { $affectedResults = $this->repo->deleteByName($apiKeyName); @@ -79,9 +75,7 @@ readonly class ApiKeyService implements ApiKeyServiceInterface } } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function disableByName(string $apiKeyName): ApiKey { $apiKey = $this->repo->findOneBy(['name' => $apiKeyName]); @@ -109,9 +103,7 @@ readonly class ApiKeyService implements ApiKeyServiceInterface return $this->repo->findBy($conditions); } - /** - * @inheritDoc - */ + /** @inheritDoc */ public function renameApiKey(Renaming $apiKeyRenaming): ApiKey { $apiKey = $this->repo->findOneBy(['name' => $apiKeyRenaming->oldName]);