mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Reduce duplication in actions listing visits
This commit is contained in:
@@ -21,9 +21,8 @@ final class OrphanVisitsParams extends VisitsParams
|
||||
parent::__construct($dateRange, $page, $itemsPerPage, $excludeBots);
|
||||
}
|
||||
|
||||
public static function fromRawData(array $query): self
|
||||
public static function fromVisitsParamsAndRawData(VisitsParams $visitsParams, array $query): self
|
||||
{
|
||||
$visitsParams = parent::fromRawData($query);
|
||||
$type = $query['type'] ?? null;
|
||||
|
||||
return new self(
|
||||
|
||||
@@ -27,7 +27,7 @@ class OrphanVisitsPaginatorAdapterTest extends TestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->repo = $this->createMock(VisitRepositoryInterface::class);
|
||||
$this->params = OrphanVisitsParams::fromRawData([]);
|
||||
$this->params = new OrphanVisitsParams();
|
||||
$this->apiKey = ApiKey::create();
|
||||
|
||||
$this->adapter = new OrphanVisitsPaginatorAdapter($this->repo, $this->params, $this->apiKey);
|
||||
|
||||
Reference in New Issue
Block a user