| Total Complexity | 4 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class MessageCollection extends Collection |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var Message |
||
| 11 | */ |
||
| 12 | private $message; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * MessageCollection constructor. |
||
| 16 | * |
||
| 17 | * @param Message $message |
||
| 18 | * @param array $items |
||
| 19 | */ |
||
| 20 | public function __construct($items = [], Message $message = null) |
||
| 21 | { |
||
| 22 | parent::__construct($items); |
||
| 23 | $this->message = $message; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function next() |
||
| 27 | { |
||
| 28 | return $this->message->next(); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Returns boolean if the page token variable is null or not |
||
| 33 | * |
||
| 34 | * @return bool |
||
| 35 | */ |
||
| 36 | public function hasNextPage() |
||
| 37 | { |
||
| 38 | return !!$this->message->pageToken; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Returns the page token or null |
||
| 43 | * |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public function getPageToken() |
||
| 49 | } |
||
| 50 | } |
||
| 51 |