Updated to provisional hero-common v4.0

This commit is contained in:
Alejandro Celaya
2021-08-04 18:46:19 +02:00
parent 555e6f804c
commit 883ac1007a
13 changed files with 31 additions and 34 deletions

View File

@@ -16,6 +16,7 @@ use function Functional\reduce_left;
use function is_array;
use function lcfirst;
use function print_r;
use function Shlinkio\Shlink\Common\buildDateRange;
use function sprintf;
use function str_repeat;
use function str_replace;
@@ -51,12 +52,7 @@ function parseDateRangeFromQuery(array $query, string $startDateName, string $en
$startDate = parseDateFromQuery($query, $startDateName);
$endDate = parseDateFromQuery($query, $endDateName);
return match (true) {
$startDate === null && $endDate === null => DateRange::emptyInstance(),
$startDate !== null && $endDate !== null => DateRange::withStartAndEndDate($startDate, $endDate),
$startDate !== null => DateRange::withStartDate($startDate),
default => DateRange::withEndDate($endDate),
};
return buildDateRange($startDate, $endDate);
}
/**