mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
Increased phpstan level to 8
This commit is contained in:
@@ -19,7 +19,7 @@ final class ShortUrlsParams
|
||||
private array $tags;
|
||||
private ShortUrlsOrdering $orderBy;
|
||||
private ?DateRange $dateRange;
|
||||
private ?int $itemsPerPage = null;
|
||||
private int $itemsPerPage;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
|
||||
@@ -29,13 +29,16 @@ final class Visitor
|
||||
$this->userAgent = $this->cropToLength($userAgent, self::USER_AGENT_MAX_LENGTH);
|
||||
$this->referer = $this->cropToLength($referer, self::REFERER_MAX_LENGTH);
|
||||
$this->visitedUrl = $this->cropToLength($visitedUrl, self::VISITED_URL_MAX_LENGTH);
|
||||
$this->remoteAddress = $this->cropToLength($remoteAddress, self::REMOTE_ADDRESS_MAX_LENGTH);
|
||||
$this->remoteAddress = $remoteAddress === null ? null : $this->cropToLength(
|
||||
$remoteAddress,
|
||||
self::REMOTE_ADDRESS_MAX_LENGTH,
|
||||
);
|
||||
$this->potentialBot = isCrawler($userAgent);
|
||||
}
|
||||
|
||||
private function cropToLength(?string $value, int $length): ?string
|
||||
private function cropToLength(string $value, int $length): string
|
||||
{
|
||||
return $value === null ? null : substr($value, 0, $length);
|
||||
return substr($value, 0, $length);
|
||||
}
|
||||
|
||||
public static function fromRequest(ServerRequestInterface $request): self
|
||||
|
||||
@@ -13,7 +13,7 @@ final class VisitsParams
|
||||
private const FIRST_PAGE = 1;
|
||||
private const ALL_ITEMS = -1;
|
||||
|
||||
private ?DateRange $dateRange;
|
||||
private DateRange $dateRange;
|
||||
private int $itemsPerPage;
|
||||
|
||||
public function __construct(
|
||||
|
||||
Reference in New Issue
Block a user