mirror of
https://github.com/shlinkio/shlink.git
synced 2026-09-03 19:52:51 -05:00
Fixed existing tests and coding styles
This commit is contained in:
@@ -29,16 +29,18 @@ class ShortUrlService implements ShortUrlServiceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $page
|
||||
* @param string|null $searchQuery
|
||||
* @param string[] $tags
|
||||
* @param array|string|null $orderBy
|
||||
* @param DateRange|null $dateRange
|
||||
*
|
||||
* @return ShortUrl[]|Paginator
|
||||
*/
|
||||
public function listShortUrls(int $page = 1, ?string $searchQuery = null, array $tags = [], $orderBy = null, ?DateRange $dateRange = null)
|
||||
{
|
||||
public function listShortUrls(
|
||||
int $page = 1,
|
||||
?string $searchQuery = null,
|
||||
array $tags = [],
|
||||
$orderBy = null,
|
||||
?DateRange $dateRange = null
|
||||
) {
|
||||
/** @var ShortUrlRepository $repo */
|
||||
$repo = $this->em->getRepository(ShortUrl::class);
|
||||
$paginator = new Paginator(new ShortUrlRepositoryAdapter($repo, $searchQuery, $tags, $orderBy, $dateRange));
|
||||
|
||||
@@ -13,16 +13,18 @@ use Zend\Paginator\Paginator;
|
||||
interface ShortUrlServiceInterface
|
||||
{
|
||||
/**
|
||||
* @param int $page
|
||||
* @param string|null $searchQuery
|
||||
* @param string[] $tags
|
||||
* @param array|string|null $orderBy
|
||||
* @return ShortUrl[]|Paginator
|
||||
* @param DateRange|null $dateRange
|
||||
*
|
||||
* @return ShortUrl[]|Paginator
|
||||
*/
|
||||
public function listShortUrls(int $page = 1, ?string $searchQuery = null, array $tags = [], $orderBy = null, ?DateRange $dateRange = null);
|
||||
public function listShortUrls(
|
||||
int $page = 1,
|
||||
?string $searchQuery = null,
|
||||
array $tags = [],
|
||||
$orderBy = null,
|
||||
?DateRange $dateRange = null
|
||||
);
|
||||
|
||||
/**
|
||||
* @param string[] $tags
|
||||
|
||||
@@ -25,7 +25,7 @@ class ShortUrlRepositoryAdapterTest extends TestCase
|
||||
/** @test */
|
||||
public function getItemsFallbacksToFindList(): void
|
||||
{
|
||||
$this->repo->findList(10, 5, 'search', ['foo', 'bar'], 'order')->shouldBeCalledOnce();
|
||||
$this->repo->findList(10, 5, 'search', ['foo', 'bar'], 'order', null)->shouldBeCalledOnce();
|
||||
$this->adapter->getItems(5, 10);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user