mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 01:33:11 +08:00
Add missing generic tyoes annotations
This commit is contained in:
@@ -37,8 +37,8 @@ class ShortUrl extends AbstractEntity
|
||||
{
|
||||
/**
|
||||
* @param Collection<int, Tag> $tags
|
||||
* @param Collection<int, Visit> & Selectable $visits
|
||||
* @param Collection<int, ShortUrlVisitsCount> & Selectable $visitsCounts
|
||||
* @param Collection<int, Visit> & Selectable<int, Visit> $visits
|
||||
* @param Collection<int, ShortUrlVisitsCount> & Selectable<int, ShortUrlVisitsCount> $visitsCounts
|
||||
*/
|
||||
private function __construct(
|
||||
private string $longUrl,
|
||||
@@ -213,7 +213,7 @@ class ShortUrl extends AbstractEntity
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection<int, Visit> & Selectable $visits
|
||||
* @param Collection<int, Visit> & Selectable<int, Visit> $visits
|
||||
* @internal
|
||||
*/
|
||||
public function setVisits(Collection & Selectable $visits): self
|
||||
|
||||
@@ -20,6 +20,7 @@ use function substr;
|
||||
use const Shlinkio\Shlink\LOOSE_URI_MATCHER;
|
||||
use const Shlinkio\Shlink\MIN_SHORT_CODES_LENGTH;
|
||||
|
||||
/** @extends InputFilter<mixed> */
|
||||
class ShortUrlInputFilter extends InputFilter
|
||||
{
|
||||
// Fields for creation only
|
||||
|
||||
@@ -13,6 +13,7 @@ use Shlinkio\Shlink\Core\ShortUrl\Model\TagsMode;
|
||||
|
||||
use function Shlinkio\Shlink\Core\enumValues;
|
||||
|
||||
/** @extends InputFilter<mixed> */
|
||||
class ShortUrlsParamsInputFilter extends InputFilter
|
||||
{
|
||||
public const PAGE = 'page';
|
||||
|
||||
@@ -6,11 +6,13 @@ namespace Shlinkio\Shlink\Core\ShortUrl\Paginator\Adapter;
|
||||
|
||||
use Pagerfanta\Adapter\AdapterInterface;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlsParams;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlWithVisitsSummary;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Persistence\ShortUrlsCountFiltering;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Persistence\ShortUrlsListFiltering;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlListRepositoryInterface;
|
||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||
|
||||
/** @implements AdapterInterface<ShortUrlWithVisitsSummary> */
|
||||
readonly class ShortUrlRepositoryAdapter implements AdapterInterface
|
||||
{
|
||||
public function __construct(
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Shlinkio\Shlink\Core\ShortUrl\Repository;
|
||||
use Happyr\DoctrineSpecification\Repository\EntitySpecificationRepository;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||
|
||||
/** @extends EntitySpecificationRepository<ShortUrl> */
|
||||
class CrawlableShortCodesQuery extends EntitySpecificationRepository implements CrawlableShortCodesQueryInterface
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ use Shlinkio\Shlink\Core\Visit\Entity\ShortUrlVisitsCount;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @extends EntitySpecificationRepository<ShortUrl> */
|
||||
class ExpiredShortUrlsRepository extends EntitySpecificationRepository implements ExpiredShortUrlsRepositoryInterface
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ use Shlinkio\Shlink\Core\Visit\Entity\ShortUrlVisitsCount;
|
||||
use function Shlinkio\Shlink\Core\ArrayUtils\map;
|
||||
use function sprintf;
|
||||
|
||||
/** @extends EntitySpecificationRepository<ShortUrl> */
|
||||
class ShortUrlListRepository extends EntitySpecificationRepository implements ShortUrlListRepositoryInterface
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ use Shlinkio\Shlink\Importer\Model\ImportedShlinkUrl;
|
||||
use function count;
|
||||
use function strtolower;
|
||||
|
||||
/** @extends EntitySpecificationRepository<ShortUrl> */
|
||||
class ShortUrlRepository extends EntitySpecificationRepository implements ShortUrlRepositoryInterface
|
||||
{
|
||||
public function findOneWithDomainFallback(ShortUrlIdentifier $identifier, ShortUrlMode $shortUrlMode): ?ShortUrl
|
||||
|
||||
@@ -13,6 +13,7 @@ use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlMode;
|
||||
use Shlinkio\Shlink\Importer\Model\ImportedShlinkUrl;
|
||||
|
||||
/** @extends ObjectRepository<ShortUrl> */
|
||||
interface ShortUrlRepositoryInterface extends ObjectRepository, EntitySpecificationRepositoryInterface
|
||||
{
|
||||
public function findOneWithDomainFallback(ShortUrlIdentifier $identifier, ShortUrlMode $shortUrlMode): ?ShortUrl;
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Core\ShortUrl;
|
||||
use Shlinkio\Shlink\Common\Paginator\Paginator;
|
||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlsParams;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlWithVisitsSummary;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Paginator\Adapter\ShortUrlRepositoryAdapter;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlListRepositoryInterface;
|
||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||
@@ -21,7 +20,7 @@ readonly class ShortUrlListService implements ShortUrlListServiceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ShortUrlWithVisitsSummary[]|Paginator
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function listShortUrls(ShortUrlsParams $params, ?ApiKey $apiKey = null): Paginator
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||
interface ShortUrlListServiceInterface
|
||||
{
|
||||
/**
|
||||
* @return ShortUrlWithVisitsSummary[]|Paginator
|
||||
* @return Paginator<ShortUrlWithVisitsSummary>
|
||||
*/
|
||||
public function listShortUrls(ShortUrlsParams $params, ?ApiKey $apiKey = null): Paginator;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user