mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-23 21:27:44 +03:00
Exposed new short URLs list filtering params
This commit is contained in:
parent
42a5296f93
commit
c3ab871366
3 changed files with 19 additions and 2 deletions
|
@ -21,6 +21,8 @@ class ShortUrlsCountFiltering
|
|||
public readonly array $tags = [],
|
||||
public readonly ?TagsMode $tagsMode = null,
|
||||
public readonly ?DateRange $dateRange = null,
|
||||
public readonly bool $excludeMaxVisitsReached = false,
|
||||
public readonly bool $excludePastValidUntil = false,
|
||||
public readonly ?ApiKey $apiKey = null,
|
||||
?string $defaultDomain = null,
|
||||
) {
|
||||
|
@ -37,6 +39,8 @@ class ShortUrlsCountFiltering
|
|||
$params->tags,
|
||||
$params->tagsMode,
|
||||
$params->dateRange,
|
||||
$params->excludeMaxVisitsReached,
|
||||
$params->excludePastValidUntil,
|
||||
$apiKey,
|
||||
$defaultDomain,
|
||||
);
|
||||
|
|
|
@ -20,10 +20,21 @@ class ShortUrlsListFiltering extends ShortUrlsCountFiltering
|
|||
array $tags = [],
|
||||
?TagsMode $tagsMode = null,
|
||||
?DateRange $dateRange = null,
|
||||
bool $excludeMaxVisitsReached = false,
|
||||
bool $excludePastValidUntil = false,
|
||||
?ApiKey $apiKey = null,
|
||||
?string $defaultDomain = null,
|
||||
) {
|
||||
parent::__construct($searchTerm, $tags, $tagsMode, $dateRange, $apiKey, $defaultDomain);
|
||||
parent::__construct(
|
||||
$searchTerm,
|
||||
$tags,
|
||||
$tagsMode,
|
||||
$dateRange,
|
||||
$excludeMaxVisitsReached,
|
||||
$excludePastValidUntil,
|
||||
$apiKey,
|
||||
$defaultDomain,
|
||||
);
|
||||
}
|
||||
|
||||
public static function fromLimitsAndParams(
|
||||
|
@ -41,6 +52,8 @@ class ShortUrlsListFiltering extends ShortUrlsCountFiltering
|
|||
$params->tags,
|
||||
$params->tagsMode,
|
||||
$params->dateRange,
|
||||
$params->excludePastValidUntil,
|
||||
$params->excludePastValidUntil,
|
||||
$apiKey,
|
||||
$defaultDomain,
|
||||
);
|
||||
|
|
|
@ -74,7 +74,7 @@ class ShortUrlRepositoryAdapterTest extends TestCase
|
|||
$dateRange = $params->dateRange;
|
||||
|
||||
$this->repo->expects($this->once())->method('countList')->with(
|
||||
new ShortUrlsCountFiltering($searchTerm, $tags, TagsMode::ANY, $dateRange, $apiKey),
|
||||
new ShortUrlsCountFiltering($searchTerm, $tags, TagsMode::ANY, $dateRange, apiKey: $apiKey),
|
||||
);
|
||||
$adapter->getNbResults();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue