mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 01:33:11 +08:00
Merge branch 'develop' into feature/consistent-default-domain-redirects
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Core\Model;
|
||||
|
||||
use Shlinkio\Shlink\Common\Paginator\Paginator;
|
||||
use Shlinkio\Shlink\Common\Util\DateRange;
|
||||
|
||||
use function Shlinkio\Shlink\Core\parseDateRangeFromQuery;
|
||||
@@ -11,7 +12,6 @@ use function Shlinkio\Shlink\Core\parseDateRangeFromQuery;
|
||||
final class VisitsParams
|
||||
{
|
||||
private const FIRST_PAGE = 1;
|
||||
private const ALL_ITEMS = -1;
|
||||
|
||||
private DateRange $dateRange;
|
||||
private int $page;
|
||||
@@ -36,10 +36,10 @@ final class VisitsParams
|
||||
private function determineItemsPerPage(?int $itemsPerPage): int
|
||||
{
|
||||
if ($itemsPerPage !== null && $itemsPerPage < 0) {
|
||||
return self::ALL_ITEMS;
|
||||
return Paginator::ALL_ITEMS;
|
||||
}
|
||||
|
||||
return $itemsPerPage ?? self::ALL_ITEMS;
|
||||
return $itemsPerPage ?? Paginator::ALL_ITEMS;
|
||||
}
|
||||
|
||||
public static function fromRawData(array $query): self
|
||||
|
||||
@@ -226,8 +226,6 @@ class VisitRepository extends EntitySpecificationRepository implements VisitRepo
|
||||
'id' => 'visit_location_id',
|
||||
]);
|
||||
|
||||
$query = $this->getEntityManager()->createNativeQuery($nativeQb->getSQL(), $rsm);
|
||||
|
||||
return $query->getResult();
|
||||
return $this->getEntityManager()->createNativeQuery($nativeQb->getSQL(), $rsm)->getResult();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Shlinkio\Shlink\Core\Validation;
|
||||
|
||||
use Laminas\InputFilter\InputFilter;
|
||||
use Shlinkio\Shlink\Common\Paginator\Paginator;
|
||||
use Shlinkio\Shlink\Common\Validation;
|
||||
|
||||
class ShortUrlsParamsInputFilter extends InputFilter
|
||||
@@ -32,7 +33,7 @@ class ShortUrlsParamsInputFilter extends InputFilter
|
||||
$this->add($this->createInput(self::SEARCH_TERM, false));
|
||||
|
||||
$this->add($this->createNumericInput(self::PAGE, false));
|
||||
$this->add($this->createNumericInput(self::ITEMS_PER_PAGE, false, -1));
|
||||
$this->add($this->createNumericInput(self::ITEMS_PER_PAGE, false, Paginator::ALL_ITEMS));
|
||||
|
||||
$this->add($this->createTagsInput(self::TAGS, false));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user