mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-22 04:26:02 +03:00
Updated paging to PHP7
This commit is contained in:
parent
61ae9bc945
commit
ac056e9f75
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user