Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepan Zolotarev committed Jan 29, 2025
1 parent ef2d56a commit cca7232
Show file tree
Hide file tree
Showing 48 changed files with 250 additions and 272 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
coverage: none
tools: composer:v2

Expand All @@ -33,7 +33,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
coverage: none
tools: composer:v2

Expand All @@ -53,7 +53,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
coverage: none
tools: composer:v2

Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: ${{ env.PHP_EXTENSIONS }}
ini-values: ${{ env.PHP_INI_VALUES }}
tools: composer:v2
Expand Down
37 changes: 18 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,34 @@
}
},
"require": {
"php": ">=8.1",
"php": ">=8.2",
"ext-json": "*",
"php-service-bus/common": "v5.1.*",
"php-service-bus/http-client": "v5.1.*",
"php-service-bus/mutex": "v5.1.*",
"php-service-bus/message-serializer": "v5.1.*",
"moneyphp/money": "v4.0.*",
"symfony/validator": "v6.0.*",
"symfony/cache": "v6.0.*",
"doctrine/annotations": "v1.13.*",
"amphp/log": "v1.1.*"
"php-service-bus/common": "v5.2.x-dev",
"php-service-bus/http-client": "v5.2.x-dev",
"php-service-bus/mutex": "v5.2.x-dev",
"php-service-bus/message-serializer": "v5.2.x-dev",
"moneyphp/money": "^v4.4",
"symfony/validator": "^6.3 || ^7.0",
"symfony/cache": "^6.3 || ^7.0",
"doctrine/annotations": "^v1.14",
"amphp/log": "v1.2.*"
},
"require-dev": {
"php-service-bus/code-style-config": "v5.1.*",
"phpunit/phpunit": "v9.5.*",
"vimeo/psalm": "v4.22.*",
"phpstan/phpstan": "v1.5.*",
"boesing/psalm-plugin-stringf": "v1.1.*"
"php-service-bus/code-style-config": "v5.2.x-dev",
"phpunit/phpunit": "^10.0 || ^11.0",
"vimeo/psalm": "^4.30 || ^5.4",
"phpstan/phpstan": "^1.12 || ^2.0"
},
"prefer-stable": true,
"minimum-stability": "stable",
"scripts": {
"psalm": "rm -rf ~/.cache/psalm/ && ./vendor/bin/psalm --config=psalm.xml",
"phpstan": "./vendor/bin/phpstan analyse src --level 9",
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose --debug",
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose --debug",
"phpstan": "./vendor/bin/phpstan analyse src",
"tests": "./vendor/bin/phpunit --configuration phpunit.xml",
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage",
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes",
"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"
"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 && ./vendor/bin/phpunit --configuration phpunit.xml"
},
"config": {
"optimize-autoloader": true,
Expand Down
11 changes: 6 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
- '#Property .* is never written, only read#'
- '#Property .* is never read, only written#'
level: 9
ignoreErrors:
- identifier: missingType.iterableValue
- identifier: property.onlyRead
- identifier: property.onlyWritten
- identifier: property.readOnlyByPhpDocDefaultValue
76 changes: 32 additions & 44 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,52 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
colors="true"
cacheResult="false"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="true"
stopOnError="false"
stopOnFailure="false"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<coverage>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory>./tests</directory>
</exclude>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
<env name="REDIS_CONNECTION_DSN" value="tcp://localhost:6379"/>
</php>
<testsuites>

<testsuite name="PHP Service Bus: Common component">
<directory>./vendor/php-service-bus/common/tests/</directory>
</testsuite>

<testsuite name="PHP Service Bus: Mutex component">
<directory>./vendor/php-service-bus/mutex/tests/</directory>
</testsuite>

<testsuite name="PHP Service Bus: Http client component">
<directory>./vendor/php-service-bus/http-client/tests/</directory>
</testsuite>

<testsuite name="PHP Service Bus: Message serializer">
<directory>./vendor/php-service-bus/message-serializer/tests/</directory>
</testsuite>

<testsuite name="PHP Service Bus: Telegram component">
<directory>./tests/</directory>
</testsuite>

</testsuites>
</phpunit>
beStrictAboutOutputDuringTests="true">
<php>
<ini name="error_reporting" value="-1"/>
<env name="REDIS_CONNECTION_DSN" value="tcp://localhost:6379"/>
</php>
<testsuites>
<testsuite name="PHP Service Bus: Common component">
<directory>./vendor/php-service-bus/common/tests/</directory>
</testsuite>
<testsuite name="PHP Service Bus: Mutex component">
<directory>./vendor/php-service-bus/mutex/tests/</directory>
</testsuite>
<testsuite name="PHP Service Bus: Http client component">
<directory>./vendor/php-service-bus/http-client/tests/</directory>
</testsuite>
<testsuite name="PHP Service Bus: Message serializer">
<directory>./vendor/php-service-bus/message-serializer/tests/</directory>
</testsuite>
<testsuite name="PHP Service Bus: Telegram component">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory>./tests</directory>
</exclude>
</source>
</phpunit>
5 changes: 1 addition & 4 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<psalm
useDocblockTypes="true"
findUnusedCode="false"
useDocblockPropertyTypes="true"
strictBinaryOperands="true"
findUnusedPsalmSuppress="true"
Expand All @@ -21,7 +21,4 @@
<PropertyNotSetInConstructor errorLevel="suppress"/>
<UnnecessaryVarAnnotation errorLevel="suppress"/>
</issueHandlers>
<plugins>
<pluginClass class="Boesing\PsalmPluginStringf\Plugin"/>
</plugins>
</psalm>
6 changes: 2 additions & 4 deletions src/Api/Method/Animation/SendAnimation.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public static function uploadFile(ChatId $chatId, InputFilePath $file, ?string $
*/
public static function withUploadedFile(ChatId $chatId, string $fileId, ?string $caption = null): self
{
if ($fileId === '')
{
if ($fileId === '') {
throw new \InvalidArgumentException('Audio file_id to send must be specified');
}

Expand All @@ -118,8 +117,7 @@ public function uploadThumbFile(InputFilePath $thumb): self

public function useUploadedThumb(string $thumbFileId): self
{
if ($thumbFileId === '')
{
if ($thumbFileId === '') {
throw new \InvalidArgumentException('Thumb file_id must be specified');
}

Expand Down
6 changes: 2 additions & 4 deletions src/Api/Method/Audio/SendAudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ public static function withUploadedFile(
?string $title = null,
?string $caption = null
): self {
if ($fileId === '')
{
if ($fileId === '') {
throw new \InvalidArgumentException('Audio file_id to send must be specified');
}

Expand Down Expand Up @@ -148,8 +147,7 @@ public function uploadThumbFile(InputFilePath $thumb): self
*/
public function useUploadedThumb(string $thumbFileId): self
{
if ($thumbFileId === '')
{
if ($thumbFileId === '') {
throw new \InvalidArgumentException('Thumb file_id must be specified');
}

Expand Down
3 changes: 1 addition & 2 deletions src/Api/Method/Chat/BroadcastType.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ final class BroadcastType implements Enum

public static function create(string $value): static
{
if (\in_array($value, self::LIST, true) === false)
{
if (\in_array($value, self::LIST, true) === false) {
throw new \InvalidArgumentException(\sprintf('Incorrect broadcast type: %s', $value));
}

Expand Down
6 changes: 2 additions & 4 deletions src/Api/Method/Document/SendDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public static function uploadFile(ChatId $chatId, InputFilePath $file, ?string $
*/
public static function withUploadedFile(ChatId $chatId, string $fileId, ?string $caption = null): self
{
if ($fileId === '')
{
if ($fileId === '') {
throw new \InvalidArgumentException('Document file_id to send must be specified');
}

Expand Down Expand Up @@ -112,8 +111,7 @@ public function uploadThumbFile(InputFilePath $thumb): self
*/
public function useUploadedThumb(string $thumbFileId): self
{
if ($thumbFileId === '')
{
if ($thumbFileId === '') {
throw new \InvalidArgumentException('Thumb file_id must be specified');
}

Expand Down
1 change: 1 addition & 0 deletions src/Api/Method/InlineQuery/AnswerInlineQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use ServiceBus\TelegramBot\Api\Type\InlineQueryResult\InlineQueryResult;
use ServiceBus\TelegramBot\Api\Type\SimpleSuccessResponse;
use ServiceBus\TelegramBot\Interaction\TelegramMethod;

use function ServiceBus\Common\jsonEncode;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Api/Method/Location/EditMessageLiveLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use ServiceBus\TelegramBot\Api\Type\Message\Message;
use ServiceBus\TelegramBot\Api\Type\Message\MessageId;
use ServiceBus\TelegramBot\Interaction\TelegramMethod;

use function ServiceBus\Common\jsonEncode;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Api/Method/Location/StopMessageLiveLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use ServiceBus\TelegramBot\Api\Type\Message\Message;
use ServiceBus\TelegramBot\Api\Type\Message\MessageId;
use ServiceBus\TelegramBot\Interaction\TelegramMethod;

use function ServiceBus\Common\jsonEncode;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Api/Method/Message/SendMediaGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use ServiceBus\TelegramBot\Api\Type\Message\Message;
use ServiceBus\TelegramBot\Api\Type\Message\MessageId;
use ServiceBus\TelegramBot\Interaction\TelegramMethod;

use function ServiceBus\Common\jsonEncode;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Api/Method/Message/SendMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ final class SendMessage extends SendEntity
/**
* Text of the message to be sent.
*
* @Assert\NotBlank()
*
* @var string
*/
#[Assert\NotBlank]
private $text;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Api/Method/Photo/SendPhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ public static function uploadFile(ChatId $chatId, InputFilePath $file, ?string $
*/
public static function withUploadedFile(ChatId $chatId, string $fileId, ?string $caption = null): self
{
if ($fileId === '')
{
if ($fileId === '') {
throw new \InvalidArgumentException('Photo file_id to send must be specified');
}

Expand Down
1 change: 1 addition & 0 deletions src/Api/Method/Poll/SendPoll.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use ServiceBus\TelegramBot\Api\Method\SendEntity;
use ServiceBus\TelegramBot\Api\Type\Chat\ChatId;

use function ServiceBus\Common\jsonEncode;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Api/Method/SendEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use ServiceBus\TelegramBot\Api\Type\Message\MessageId;
use ServiceBus\TelegramBot\Api\Type\ReplayMarkup;
use ServiceBus\TelegramBot\Interaction\TelegramMethod;

use function ServiceBus\Common\jsonEncode;

/**
Expand Down
6 changes: 2 additions & 4 deletions src/Api/Method/Video/SendVideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ public static function uploadFile(ChatId $chatId, InputFilePath $file, ?string $
*/
public static function withUploadedFile(ChatId $chatId, string $fileId, ?string $caption = null): self
{
if ($fileId === '')
{
if ($fileId === '') {
throw new \InvalidArgumentException('Video file_id to send must be specified');
}

Expand Down Expand Up @@ -155,8 +154,7 @@ public function uploadThumbFile(InputFilePath $thumb): self
*/
public function useUploadedThumb(string $thumbFileId): self
{
if ($thumbFileId === '')
{
if ($thumbFileId === '') {
throw new \InvalidArgumentException('Thumb file_id must be specified');
}

Expand Down
6 changes: 2 additions & 4 deletions src/Api/Method/Video/SendVideoNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ public static function uploadFile(ChatId $chatId, InputFilePath $file): self
*/
public static function withUploadedFile(ChatId $chatId, string $fileId): self
{
if ($fileId === '')
{
if ($fileId === '') {
throw new \InvalidArgumentException('Video note file_id to send must be specified');
}

Expand Down Expand Up @@ -118,8 +117,7 @@ public function uploadThumbFile(InputFilePath $thumb): self
*/
public function useUploadedThumb(string $thumbFileId): self
{
if ($thumbFileId === '')
{
if ($thumbFileId === '') {
throw new \InvalidArgumentException('Thumb file_id must be specified');
}

Expand Down
3 changes: 1 addition & 2 deletions src/Api/Method/Voice/SendVoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ public static function uploadFile(ChatId $chatId, InputFilePath $file, ?string $
*/
public static function withUploadedFile(ChatId $chatId, string $fileId, ?string $caption): self
{
if ($fileId === '')
{
if ($fileId === '') {
throw new \InvalidArgumentException('Voice file_id to send must be specified');
}

Expand Down
Loading

0 comments on commit cca7232

Please sign in to comment.