mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Fixed merge conflicts
This commit is contained in:
commit
c9ce111643
18
CHANGELOG.md
18
CHANGELOG.md
@ -35,6 +35,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||||||
* *Nothing*
|
* *Nothing*
|
||||||
|
|
||||||
|
|
||||||
|
## [2.7.3] - 2021-08-02
|
||||||
|
### Added
|
||||||
|
* *Nothing*
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
* *Nothing*
|
||||||
|
|
||||||
|
### Deprecated
|
||||||
|
* *Nothing*
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
* *Nothing*
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* [#1135](https://github.com/shlinkio/shlink/issues/1135) Fixed error when importing short URLs with no visits from another Shlink instance.
|
||||||
|
* [#1136](https://github.com/shlinkio/shlink/issues/1136) Fixed error when fetching tag/short-url/orphan visits for a page lower than 1.
|
||||||
|
|
||||||
|
|
||||||
## [2.7.2] - 2021-07-30
|
## [2.7.2] - 2021-07-30
|
||||||
### Added
|
### Added
|
||||||
* *Nothing*
|
* *Nothing*
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
"shlinkio/shlink-common": "^3.7",
|
"shlinkio/shlink-common": "^3.7",
|
||||||
"shlinkio/shlink-config": "^1.0",
|
"shlinkio/shlink-config": "^1.0",
|
||||||
"shlinkio/shlink-event-dispatcher": "^2.1",
|
"shlinkio/shlink-event-dispatcher": "^2.1",
|
||||||
"shlinkio/shlink-importer": "^2.3",
|
"shlinkio/shlink-importer": "^2.3.1",
|
||||||
"shlinkio/shlink-installer": "dev-develop#fa6a4ca as 6.1",
|
"shlinkio/shlink-installer": "dev-develop#fa6a4ca as 6.1",
|
||||||
"shlinkio/shlink-ip-geolocation": "^2.0",
|
"shlinkio/shlink-ip-geolocation": "^2.0",
|
||||||
"symfony/console": "^5.1",
|
"symfony/console": "^5.1",
|
||||||
|
@ -15,11 +15,11 @@ final class ShortUrlsParams
|
|||||||
public const DEFAULT_ITEMS_PER_PAGE = 10;
|
public const DEFAULT_ITEMS_PER_PAGE = 10;
|
||||||
|
|
||||||
private int $page;
|
private int $page;
|
||||||
|
private int $itemsPerPage;
|
||||||
private ?string $searchTerm;
|
private ?string $searchTerm;
|
||||||
private array $tags;
|
private array $tags;
|
||||||
private ShortUrlsOrdering $orderBy;
|
private ShortUrlsOrdering $orderBy;
|
||||||
private ?DateRange $dateRange;
|
private ?DateRange $dateRange;
|
||||||
private int $itemsPerPage;
|
|
||||||
|
|
||||||
private function __construct()
|
private function __construct()
|
||||||
{
|
{
|
||||||
|
@ -14,18 +14,25 @@ final class VisitsParams
|
|||||||
private const ALL_ITEMS = -1;
|
private const ALL_ITEMS = -1;
|
||||||
|
|
||||||
private DateRange $dateRange;
|
private DateRange $dateRange;
|
||||||
|
private int $page;
|
||||||
private int $itemsPerPage;
|
private int $itemsPerPage;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
?DateRange $dateRange = null,
|
?DateRange $dateRange = null,
|
||||||
private int $page = self::FIRST_PAGE,
|
int $page = self::FIRST_PAGE,
|
||||||
?int $itemsPerPage = null,
|
?int $itemsPerPage = null,
|
||||||
private bool $excludeBots = false
|
private bool $excludeBots = false
|
||||||
) {
|
) {
|
||||||
$this->dateRange = $dateRange ?? new DateRange();
|
$this->dateRange = $dateRange ?? new DateRange();
|
||||||
|
$this->page = $this->determinePage($page);
|
||||||
$this->itemsPerPage = $this->determineItemsPerPage($itemsPerPage);
|
$this->itemsPerPage = $this->determineItemsPerPage($itemsPerPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function determinePage(int $page): int
|
||||||
|
{
|
||||||
|
return $page > 0 ? $page : self::FIRST_PAGE;
|
||||||
|
}
|
||||||
|
|
||||||
private function determineItemsPerPage(?int $itemsPerPage): int
|
private function determineItemsPerPage(?int $itemsPerPage): int
|
||||||
{
|
{
|
||||||
if ($itemsPerPage !== null && $itemsPerPage < 0) {
|
if ($itemsPerPage !== null && $itemsPerPage < 0) {
|
||||||
@ -39,7 +46,7 @@ final class VisitsParams
|
|||||||
{
|
{
|
||||||
return new self(
|
return new self(
|
||||||
parseDateRangeFromQuery($query, 'startDate', 'endDate'),
|
parseDateRangeFromQuery($query, 'startDate', 'endDate'),
|
||||||
(int) ($query['page'] ?? 1),
|
(int) ($query['page'] ?? self::FIRST_PAGE),
|
||||||
isset($query['itemsPerPage']) ? (int) $query['itemsPerPage'] : null,
|
isset($query['itemsPerPage']) ? (int) $query['itemsPerPage'] : null,
|
||||||
isset($query['excludeBots']),
|
isset($query['excludeBots']),
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user