1111 */
1212class InlineKeyboardPagination implements InlineKeyboardPaginator
1313{
14- private array $ items ;
15- private int $ itemsPerPage ;
16- private int $ selectedPage ;
17- private int $ maxButtons = 5 ;
18- private bool $ forceButtonCount = false ;
19- private string $ command ;
20- private string $ callbackDataFormat = 'command={COMMAND}&oldPage={OLD_PAGE}&newPage={NEW_PAGE} ' ;
21- private array $ labels = [
14+ protected array $ items ;
15+ protected int $ itemsPerPage ;
16+ protected int $ selectedPage ;
17+ protected int $ maxButtons = 5 ;
18+ protected bool $ forceButtonCount = false ;
19+ protected string $ command ;
20+ protected string $ callbackDataFormat = 'command={COMMAND}&oldPage={OLD_PAGE}&newPage={NEW_PAGE} ' ;
21+ protected array $ labels = [
2222 'default ' => '%d ' ,
2323 'first ' => '« %d ' ,
2424 'previous ' => '‹ %d ' ,
@@ -31,10 +31,10 @@ class InlineKeyboardPagination implements InlineKeyboardPaginator
3131 * @param int $maxButtons
3232 * @param bool $forceButtonCount
3333 *
34- * @return $this
34+ * @return self
3535 * @throws InlineKeyboardPaginationException
3636 */
37- public function setMaxButtons (int $ maxButtons = 5 , bool $ forceButtonCount = false ): InlineKeyboardPagination
37+ public function setMaxButtons (int $ maxButtons = 5 , bool $ forceButtonCount = false ): self
3838 {
3939 if ($ maxButtons < 5 || $ maxButtons > 8 ) {
4040 throw InlineKeyboardPaginationException::invalidMaxButtons ();
@@ -61,9 +61,9 @@ public function getCallbackDataFormat(): string
6161 *
6262 * @param string $callbackDataFormat
6363 *
64- * @return InlineKeyboardPagination
64+ * @return self
6565 */
66- public function setCallbackDataFormat (string $ callbackDataFormat ): InlineKeyboardPagination
66+ public function setCallbackDataFormat (string $ callbackDataFormat ): self
6767 {
6868 $ this ->callbackDataFormat = $ callbackDataFormat ;
6969
@@ -85,9 +85,9 @@ public function getLabels(): array
8585 *
8686 * @param array $labels
8787 *
88- * @return InlineKeyboardPagination
88+ * @return self
8989 */
90- public function setLabels (array $ labels ): InlineKeyboardPagination
90+ public function setLabels (array $ labels ): self
9191 {
9292 $ this ->labels = $ labels ;
9393
@@ -97,7 +97,7 @@ public function setLabels(array $labels): InlineKeyboardPagination
9797 /**
9898 * @inheritdoc
9999 */
100- public function setCommand (string $ command = 'pagination ' ): InlineKeyboardPagination
100+ public function setCommand (string $ command = 'pagination ' ): self
101101 {
102102 $ this ->command = $ command ;
103103
@@ -108,7 +108,7 @@ public function setCommand(string $command = 'pagination'): InlineKeyboardPagina
108108 * @inheritdoc
109109 * @throws InlineKeyboardPaginationException
110110 */
111- public function setSelectedPage (int $ selectedPage ): InlineKeyboardPagination
111+ public function setSelectedPage (int $ selectedPage ): self
112112 {
113113 $ numberOfPages = $ this ->getNumberOfPages ();
114114 if ($ selectedPage < 1 || $ selectedPage > $ numberOfPages ) {
@@ -135,10 +135,10 @@ public function getItemsPerPage(): int
135135 *
136136 * @param int $itemsPerPage
137137 *
138- * @return InlineKeyboardPagination
138+ * @return self
139139 * @throws InlineKeyboardPaginationException
140140 */
141- public function setItemsPerPage (int $ itemsPerPage ): InlineKeyboardPagination
141+ public function setItemsPerPage (int $ itemsPerPage ): self
142142 {
143143 if ($ itemsPerPage <= 0 ) {
144144 throw InlineKeyboardPaginationException::invalidItemsPerPage ();
@@ -154,10 +154,10 @@ public function setItemsPerPage(int $itemsPerPage): InlineKeyboardPagination
154154 *
155155 * @param array $items
156156 *
157- * @return InlineKeyboardPagination
157+ * @return self
158158 * @throws InlineKeyboardPaginationException
159159 */
160- public function setItems (array $ items ): InlineKeyboardPagination
160+ public function setItems (array $ items ): self
161161 {
162162 if (empty ($ items )) {
163163 throw InlineKeyboardPaginationException::noItems ();
0 commit comments