Skip to content

Commit 11824f5

Browse files
author
eldarQa
committed
Support PHP 7.3 + updated Travis config
1 parent 2e1ae1f commit 11824f5

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ cache:
77
- "$HOME/.composer/cache"
88

99
php:
10+
- 7.3
11+
- 7.4
1012
- 8.0
1113
- nightly
1214
- hhvm
@@ -30,7 +32,7 @@ install:
3032

3133
script:
3234
- composer check-code
33-
- if [ "$TRAVIS_PHP_VERSION" == "8.0" ]; then composer test-cov; else composer test; fi
35+
- if [ "$TRAVIS_PHP_VERSION" >= "7.3" ]; then composer test-cov; else composer test; fi
3436

3537
after_script:
36-
- if [ "$TRAVIS_PHP_VERSION" == "8.0" ]; then composer test-cov-upload; fi
38+
- if [ "$TRAVIS_PHP_VERSION" >= "7.3" ]; then composer test-cov-upload; fi

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525
],
2626
"require": {
27-
"php": "^8.0"
27+
"php": "^7.3|^8.0"
2828
},
2929
"require-dev": {
3030
"jakub-onderka/php-parallel-lint": "^0.9.2",

src/InlineKeyboardPagination.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace TelegramBot\InlineKeyboardPagination;
44

5-
use JetBrains\PhpStorm\ArrayShape;
6-
use JetBrains\PhpStorm\Pure;
75
use TelegramBot\InlineKeyboardPagination\Exceptions\InlineKeyboardPaginationException;
86

97
/**
@@ -16,42 +14,42 @@ class InlineKeyboardPagination implements InlineKeyboardPaginator
1614
/**
1715
* @var int
1816
*/
19-
private int $itemsPerPage;
17+
private $itemsPerPage;
2018

2119
/**
2220
* @var int
2321
*/
24-
private int $maxButtons = 5;
22+
private $maxButtons = 5;
2523

2624
/**
2725
* @var bool
2826
*/
29-
private bool $forceButtonCount = false;
27+
private $forceButtonCount = false;
3028

3129
/**
3230
* @var int
3331
*/
34-
private int $selectedPage;
32+
private $selectedPage;
3533

3634
/**
3735
* @var array
3836
*/
39-
private array $items;
37+
private $items;
4038

4139
/**
4240
* @var string
4341
*/
44-
private string $command;
42+
private $command;
4543

4644
/**
4745
* @var string
4846
*/
49-
private string $callbackDataFormat = 'command={COMMAND}&oldPage={OLD_PAGE}&newPage={NEW_PAGE}';
47+
private $callbackDataFormat = 'command={COMMAND}&oldPage={OLD_PAGE}&newPage={NEW_PAGE}';
5048

5149
/**
5250
* @var array
5351
*/
54-
private array $labels = [
52+
private $labels = [
5553
'default' => '%d',
5654
'first' => '« %d',
5755
'previous' => '‹ %d',
@@ -233,7 +231,6 @@ public function __construct(
233231
* @inheritdoc
234232
* @throws InlineKeyboardPaginationException
235233
*/
236-
#[ArrayShape(['items' => 'array', 'keyboard' => 'array'])]
237234
public function getPagination(
238235
int $selectedPage = null
239236
): array {
@@ -350,7 +347,6 @@ protected function generateRange(): array
350347
*
351348
* @return array
352349
*/
353-
#[ArrayShape(['text' => 'string', 'callback_data' => 'string'])]
354350
protected function generateButton(
355351
int $page
356352
): array {
@@ -381,7 +377,6 @@ protected function generateCallbackData(int $page): string
381377
*
382378
* @return array
383379
*/
384-
#[Pure]
385380
protected function getPreparedItems(): array
386381
{
387382
return array_slice($this->items, $this->getOffset(), $this->itemsPerPage);

tests/InlineKeyboardPaginationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ final class InlineKeyboardPaginationTest extends \PHPUnit\Framework\TestCase
1212
/**
1313
* @var int
1414
*/
15-
private int $itemsPerPage = 5;
15+
private $itemsPerPage = 5;
1616

1717
/**
1818
* @var int
1919
*/
20-
private int $selectedPage;
20+
private $selectedPage;
2121

2222
/**
2323
* @var string
2424
*/
25-
private string $command;
25+
private $command;
2626

2727
/**
2828
* @var array
2929
*/
30-
private array $items;
30+
private $items;
3131

3232
/**
3333
* InlineKeyboardPaginationTest constructor.

0 commit comments

Comments
 (0)