diff --git a/composer.json b/composer.json index b448f12..9485a38 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ }, "require-dev": { "ext-xdebug": "*", - "aplus/coding-standard": "^2.1", + "aplus/coding-standard": "^2.8", "ergebnis/composer-normalize": "^2.25", "jetbrains/phpstorm-attributes": "^1.0", "phpmd/phpmd": "^2.13", diff --git a/src/Pager.php b/src/Pager.php index 86389ea..56947b8 100644 --- a/src/Pager.php +++ b/src/Pager.php @@ -106,8 +106,8 @@ public function __construct( int | string $currentPage, int | string $itemsPerPage, int $totalItems, - Language $language = null, - string $url = null + ?Language $language = null, + ?string $url = null ) { if ($language) { $this->setLanguage($language); @@ -186,7 +186,7 @@ protected function setTotalItems(int $totalItems) : static * * @return static */ - public function setLanguage(Language $language = null) : static + public function setLanguage(?Language $language = null) : static { $this->language = $language ?? new Language(); $this->language->addDirectory(__DIR__ . '/Languages'); @@ -286,7 +286,7 @@ public function getQuery() : string * * @return static */ - public function setAllowedQueries(array | null $allowed) : static + public function setAllowedQueries(?array $allowed) : static { $this->setUrl($this->oldUrl, $allowed); return $this; @@ -303,13 +303,13 @@ protected function prepareUrl() : static } /** - * @param string|URL $currentPageUrl + * @param URL|string $currentPageUrl * @param array|null $allowedQueries List of queries, an empty array * to allow only the default or null to allow all * * @return static */ - public function setUrl(string | URL $currentPageUrl, array $allowedQueries = null) : static + public function setUrl(URL | string $currentPageUrl, ?array $allowedQueries = null) : static { $currentPageUrl = $currentPageUrl instanceof URL ? clone $currentPageUrl @@ -529,7 +529,7 @@ public function getWithUrl() : array * * @return string */ - public function render(string $view = null) : string + public function render(?string $view = null) : string { $filename = $this->getView($view ?? $this->getDefaultView()); \ob_start();