diff --git a/src/Model/PaginationResponse.php b/src/Model/PaginationResponse.php index 470e216..42d297d 100644 --- a/src/Model/PaginationResponse.php +++ b/src/Model/PaginationResponse.php @@ -19,41 +19,25 @@ trait PaginationResponse /** * @var array */ - protected $paging; + private $paging; public function getNextUrl(): ?string { - if (!isset($this->paging['next'])) { - return null; - } - - return $this->paging['next']; + return $this->paging['next'] ?? null; } public function getPreviousUrl(): ?string { - if (!isset($this->paging['previous'])) { - return null; - } - - return $this->paging['previous']; + return $this->paging['previous'] ?? null; } public function getFirstUrl(): ?string { - if (!isset($this->paging['first'])) { - return null; - } - - return $this->paging['first']; + return $this->paging['first'] ?? null; } public function getLastUrl(): ?string { - if (!isset($this->paging['last'])) { - return null; - } - - return $this->paging['last']; + return $this->paging['last'] ?? null; } } diff --git a/src/Model/PagingProvider.php b/src/Model/PagingProvider.php index ab79b15..be1e8ad 100644 --- a/src/Model/PagingProvider.php +++ b/src/Model/PagingProvider.php @@ -18,29 +18,21 @@ interface PagingProvider { /** * Returns the `$paging->next` URL. - * - * @return string */ - public function getNextUrl(); + public function getNextUrl(): ?string; /** * Returns the `$paging->prev` URL. - * - * @return string */ - public function getPreviousUrl(); + public function getPreviousUrl(): ?string; /** * Returns the `$paging->first` URL. - * - * @return string */ - public function getFirstUrl(); + public function getFirstUrl(): ?string; /** * Returns the `$paging->last` URL. - * - * @return string */ - public function getLastUrl(); + public function getLastUrl(): ?string; }