mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 01:03:13 +08:00
Update to PHP coding standard 2.4.0
This commit is contained in:
@@ -13,18 +13,18 @@ abstract class AbstractInfinitePaginableListParams
|
||||
public readonly int $page;
|
||||
public readonly int $itemsPerPage;
|
||||
|
||||
protected function __construct(?int $page, ?int $itemsPerPage)
|
||||
protected function __construct(int|null $page, int|null $itemsPerPage)
|
||||
{
|
||||
$this->page = $this->determinePage($page);
|
||||
$this->itemsPerPage = $this->determineItemsPerPage($itemsPerPage);
|
||||
}
|
||||
|
||||
private function determinePage(?int $page): int
|
||||
private function determinePage(int|null $page): int
|
||||
{
|
||||
return $page === null || $page <= 0 ? self::FIRST_PAGE : $page;
|
||||
}
|
||||
|
||||
private function determineItemsPerPage(?int $itemsPerPage): int
|
||||
private function determineItemsPerPage(int|null $itemsPerPage): int
|
||||
{
|
||||
return $itemsPerPage === null || $itemsPerPage < 0 ? Paginator::ALL_ITEMS : $itemsPerPage;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ enum DeviceType: string
|
||||
case IOS = 'ios';
|
||||
case DESKTOP = 'desktop';
|
||||
|
||||
public static function matchFromUserAgent(string $userAgent): ?self
|
||||
public static function matchFromUserAgent(string $userAgent): self|null
|
||||
{
|
||||
$detect = new MobileDetect();
|
||||
$detect->setUserAgent($userAgent);
|
||||
|
||||
@@ -10,7 +10,7 @@ final readonly class Ordering
|
||||
private const ASC_DIR = 'ASC';
|
||||
private const DEFAULT_DIR = self::ASC_DIR;
|
||||
|
||||
public function __construct(public ?string $field = null, public string $direction = self::DEFAULT_DIR)
|
||||
public function __construct(public string|null $field = null, public string $direction = self::DEFAULT_DIR)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user