Skip to content

Commit 29996a8

Browse files
committed
update php version to 8.1
1 parent 56b0e68 commit 29996a8

File tree

179 files changed

+424
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+424
-430
lines changed

.github/workflows/continuous-integration.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install PHP
1414
uses: shivammathur/setup-php@v2
1515
with:
16-
php-version: 8.0
16+
php-version: 8.1
1717
coverage: none
1818
tools: composer:v2
1919

@@ -33,7 +33,7 @@ jobs:
3333
- name: Install PHP
3434
uses: shivammathur/setup-php@v2
3535
with:
36-
php-version: 8.0
36+
php-version: 8.1
3737
coverage: none
3838
tools: composer:v2
3939

@@ -53,15 +53,15 @@ jobs:
5353
- name: Install PHP
5454
uses: shivammathur/setup-php@v2
5555
with:
56-
php-version: 8.0
56+
php-version: 8.1
5757
coverage: none
5858
tools: composer:v2
5959

6060
- name: Install dependencies with composer
6161
run: composer update --no-ansi --no-interaction --no-progress
6262

6363
- name: Run phpstan/phpstan
64-
run: rm -rf ~/.cache/psalm/ && ./vendor/bin/phpstan analyse src --level 7
64+
run: rm -rf ~/.cache/psalm/ && ./vendor/bin/phpstan analyse src --level 9
6565

6666
phpunit:
6767
name: PHPUnit
@@ -82,7 +82,7 @@ jobs:
8282
- name: Install PHP with extensions
8383
uses: shivammathur/setup-php@v2
8484
with:
85-
php-version: 8.0
85+
php-version: 8.1
8686
extensions: ${{ env.PHP_EXTENSIONS }}
8787
ini-values: ${{ env.PHP_INI_VALUES }}
8888
tools: composer:v2
File renamed without changes.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Packagist](https://img.shields.io/packagist/v/php-service-bus/telegram-bot-core.svg)](https://packagist.org/packages/php-service-bus/telegram-bot-core)
44
[![Packagist](https://img.shields.io/packagist/dt/php-service-bus/telegram-bot-core.svg)](https://packagist.org/packages/php-service-bus/telegram-bot-core)
55
![Continuous Integration](https://github.com/php-service-bus/telegram-bot-core/workflows/Continuous%20Integration/badge.svg)
6-
[![codecov](https://codecov.io/gh/php-service-bus/telegram-bot-core/branch/v5.0/graph/badge.svg?token=0bKwdiuo0S)](https://codecov.io/gh/php-service-bus/telegram-bot-core)
6+
[![codecov](https://codecov.io/gh/php-service-bus/telegram-bot-core/branch/v5.1/graph/badge.svg?token=0bKwdiuo0S)](https://codecov.io/gh/php-service-bus/telegram-bot-core)
77
[![Shepherd](https://shepherd.dev/github/php-service-bus/telegram-bot-core/coverage.svg)](https://shepherd.dev/github/php-service-bus/telegram-bot-core)
88

99
[Telegram Bot API](https://core.telegram.org/bots/api) implementation

composer.json

+20-18
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,35 @@
3030
}
3131
},
3232
"require": {
33-
"php": ">=8.0",
33+
"php": ">=8.1",
3434
"ext-json": "*",
35-
"php-service-bus/common": "v5.0.*",
36-
"php-service-bus/http-client": "v5.0.*",
37-
"php-service-bus/mutex":"v5.0.*",
38-
"php-service-bus/message-serializer":"v5.0.*",
39-
"moneyphp/money": "v3.3.*",
40-
"symfony/validator": "v5.2.*",
41-
"doctrine/cache": "v1.10.*",
35+
"php-service-bus/common": "v5.1.*",
36+
"php-service-bus/http-client": "v5.1.*",
37+
"php-service-bus/mutex": "v5.1.*",
38+
"php-service-bus/message-serializer": "v5.1.*",
39+
"moneyphp/money": "v4.0.*",
40+
"symfony/validator": "v5.4.*",
41+
"symfony/cache": "v5.4.*",
42+
"doctrine/annotations": "v1.13.*",
4243
"amphp/log": "v1.1.*"
4344
},
4445
"require-dev": {
45-
"php-service-bus/code-style-config": "v1.3.*",
46+
"php-service-bus/code-style-config": "v5.1.*",
4647
"phpunit/phpunit": "v9.5.*",
47-
"vimeo/psalm": "v4.6.*",
48-
"phpstan/phpstan": "v0.12.*"
48+
"vimeo/psalm": "v4.13.*",
49+
"phpstan/phpstan": "v1.2.*",
50+
"boesing/psalm-plugin-stringf": "v1.1.*"
4951
},
5052
"prefer-stable": true,
51-
"minimum-stability": "dev",
53+
"minimum-stability": "stable",
5254
"scripts": {
5355
"psalm": "rm -rf ~/.cache/psalm/ && ./vendor/bin/psalm --config=psalm.xml",
54-
"phpstan": "./vendor/bin/phpstan analyse src --level 7",
55-
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --debug --verbose --debug",
56-
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --debug --verbose --debug",
57-
"cs-check": "./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
58-
"cs-fix": "./vendor/bin/php-cs-fixer fix --allow-risky=yes",
59-
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 7 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
56+
"phpstan": "./vendor/bin/phpstan analyse src --level 9",
57+
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose --debug",
58+
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose --debug",
59+
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
60+
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes",
61+
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 9 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
6062
},
6163
"config": {
6264
"optimize-autoloader": true

phpstan.neon

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
parameters:
2-
checkGenericClassInNonGenericObjectType: false
3-
checkMissingIterableValueType: false
4-
ignoreErrors:
5-
-
6-
message: '#with type mixed is not subtype of native type object#'
7-
path: %currentWorkingDirectory%/src
8-
-
9-
message: '#should return stati#'
10-
path: %currentWorkingDirectory%/src
2+
checkMissingIterableValueType: false
3+
checkGenericClassInNonGenericObjectType: false
4+
ignoreErrors:
5+
- '#Cannot cast mixed to int#'
6+
- '#Property .* is never written, only read#'
7+
- '#Property .* is never read, only written#'

phpunit.xml

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false"
3-
backupStaticAttributes="false" beStrictAboutTestsThatDoNotTestAnything="false" colors="true" verbose="true"
4-
convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true"
5-
failOnRisky="true" failOnWarning="true" stopOnFailure="false"
6-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
colors="true"
5+
cacheResult="false"
6+
convertDeprecationsToExceptions="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="true"
11+
stopOnError="false"
12+
stopOnFailure="false"
13+
beStrictAboutChangesToGlobalState="true"
14+
beStrictAboutOutputDuringTests="true"
15+
verbose="true"
16+
>
717
<coverage>
818
<include>
919
<directory>./src</directory>
@@ -18,23 +28,23 @@
1828
</php>
1929
<testsuites>
2030

21-
<testsuite name="Component: common">
31+
<testsuite name="PHP Service Bus: Common component">
2232
<directory>./vendor/php-service-bus/common/tests/</directory>
2333
</testsuite>
2434

25-
<testsuite name="Component: mutex">
35+
<testsuite name="PHP Service Bus: Mutex component">
2636
<directory>./vendor/php-service-bus/mutex/tests/</directory>
2737
</testsuite>
2838

29-
<testsuite name="Component: http client">
39+
<testsuite name="PHP Service Bus: Http client component">
3040
<directory>./vendor/php-service-bus/http-client/tests/</directory>
3141
</testsuite>
3242

33-
<testsuite name="Component: message serializer">
43+
<testsuite name="PHP Service Bus: Message serializer">
3444
<directory>./vendor/php-service-bus/message-serializer/tests/</directory>
3545
</testsuite>
3646

37-
<testsuite name="Telegram component">
47+
<testsuite name="PHP Service Bus: Telegram component">
3848
<directory>./tests/</directory>
3949
</testsuite>
4050

psalm.xml

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
totallyTyped="true"
44
useDocblockTypes="true"
55
useDocblockPropertyTypes="true"
6-
allowPhpStormGenerics="true"
76
strictBinaryOperands="true"
87
findUnusedPsalmSuppress="true"
98
ignoreInternalFunctionFalseReturn="false"
@@ -21,5 +20,9 @@
2120

2221
<issueHandlers>
2322
<PropertyNotSetInConstructor errorLevel="suppress"/>
23+
<UnnecessaryVarAnnotation errorLevel="suppress"/>
2424
</issueHandlers>
25-
</psalm>
25+
<plugins>
26+
<pluginClass class="Boesing\PsalmPluginStringf\Plugin"/>
27+
</plugins>
28+
</psalm>

src/Api/Method/Animation/SendAnimation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Animation;
1414

src/Api/Method/Audio/SendAudio.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Audio;
1414

src/Api/Method/CallbackQuery/AnswerCallbackQuery.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\CallbackQuery;
1414

src/Api/Method/Chat/BroadcastType.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Chat;
1414

@@ -57,9 +57,6 @@ final class BroadcastType implements Enum
5757
*/
5858
private $value;
5959

60-
/**
61-
* @psalm-suppress MoreSpecificReturnType
62-
*/
6360
public static function create(string $value): static
6461
{
6562
if (\in_array($value, self::LIST, true) === false)

src/Api/Method/Chat/ChatInviteLink.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Chat;
1414

src/Api/Method/Chat/GetChat.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Chat;
1414

src/Api/Method/Chat/GetChatAdministrators.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Chat;
1414

src/Api/Method/Chat/GetChatMember.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Chat;
1414

src/Api/Method/Chat/GetChatMembersCount.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Chat;
1414

src/Api/Method/Chat/LeaveChat.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Chat;
1414

src/Api/Method/Chat/SendChatAction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\Chat;
1414

src/Api/Method/ChatManage/DeleteChatPhoto.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatManage;
1414

src/Api/Method/ChatManage/ExportChatInviteLink.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatManage;
1414

src/Api/Method/ChatManage/SetChatDescription.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatManage;
1414

src/Api/Method/ChatManage/SetChatPhoto.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatManage;
1414

src/Api/Method/ChatManage/SetChatTitle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatManage;
1414

src/Api/Method/ChatModeration/KickChatMember.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatModeration;
1414

src/Api/Method/ChatModeration/PinChatMessage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatModeration;
1414

src/Api/Method/ChatModeration/PromoteChatMember.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatModeration;
1414

src/Api/Method/ChatModeration/RestrictChatMember.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatModeration;
1414

src/Api/Method/ChatModeration/UnbanChatMember.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\TelegramBot\Api\Method\ChatModeration;
1414

0 commit comments

Comments
 (0)