From 5b0e5c8cb041b2c4ba82c7d37ec2e813f0d716e2 Mon Sep 17 00:00:00 2001 From: viktorprogger Date: Wed, 26 Feb 2025 15:30:15 +0500 Subject: [PATCH] Add php 8.4 support --- .github/workflows/build.yml | 3 ++- .github/workflows/composer-dependency-analyser.yml | 1 + .github/workflows/static.yml | 3 ++- composer.json | 2 +- src/Console/GetUpdatesCommand.php | 2 +- src/Console/SetTelegramWebhookCommand.php | 2 +- tests/Middleware/MiddlewareDispatcherTest.php | 2 +- tests/Middleware/MiddlewareFactoryTest.php | 2 +- 8 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9342f1c..52bb333 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,7 @@ jobs: php: - 8.2 - 8.3 + - 8.4 steps: - name: Checkout @@ -63,7 +64,7 @@ jobs: run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Cache dependencies installed with composer - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.COMPOSER_CACHE_DIR }} key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.github/workflows/composer-dependency-analyser.yml b/.github/workflows/composer-dependency-analyser.yml index 6bb3328..97fb51f 100644 --- a/.github/workflows/composer-dependency-analyser.yml +++ b/.github/workflows/composer-dependency-analyser.yml @@ -40,6 +40,7 @@ jobs: php: - 8.2 - 8.3 + - 8.4 steps: - name: Checkout diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 3a19005..95f7566 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -35,6 +35,7 @@ jobs: php: - 8.2 - 8.3 + - 8.4 steps: - name: Checkout @@ -51,7 +52,7 @@ jobs: run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - name: Cache dependencies installed with composer - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.COMPOSER_CACHE_DIR }} key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/composer.json b/composer.json index a0b8c75..be8f11a 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ }, "minimum-stability": "stable", "require": { - "php": "^8.2", + "php": "~8.2||~8.3||~8.4", "botasis/telegram-client": "^1.0", "psr/container": "^2.0", "psr/event-dispatcher": "^1.0", diff --git a/src/Console/GetUpdatesCommand.php b/src/Console/GetUpdatesCommand.php index e0ea8d5..ff3c630 100644 --- a/src/Console/GetUpdatesCommand.php +++ b/src/Console/GetUpdatesCommand.php @@ -26,7 +26,7 @@ public function __construct( private readonly Application $application, private readonly UpdateFactory $updateFactory, private readonly LoggerInterface $logger = new NullLogger(), - string $name = null, + ?string $name = null, ) { parent::__construct($name); } diff --git a/src/Console/SetTelegramWebhookCommand.php b/src/Console/SetTelegramWebhookCommand.php index 946a63e..174816b 100644 --- a/src/Console/SetTelegramWebhookCommand.php +++ b/src/Console/SetTelegramWebhookCommand.php @@ -24,7 +24,7 @@ final class SetTelegramWebhookCommand extends Command public function __construct( private readonly ClientInterface $client, private readonly QuestionHelper $questionHelper, - string $name = null + ?string $name = null ) { parent::__construct($name); } diff --git a/tests/Middleware/MiddlewareDispatcherTest.php b/tests/Middleware/MiddlewareDispatcherTest.php index 7b103c8..993eadf 100644 --- a/tests/Middleware/MiddlewareDispatcherTest.php +++ b/tests/Middleware/MiddlewareDispatcherTest.php @@ -205,7 +205,7 @@ public function handle(Update $update): ResponseInterface } private function createDispatcher( - ContainerInterface $container = null, + ?ContainerInterface $container = null, ?EventDispatcherInterface $eventDispatcher = null ): MiddlewareDispatcher { $container = $container ?? $this->createContainer(); diff --git a/tests/Middleware/MiddlewareFactoryTest.php b/tests/Middleware/MiddlewareFactoryTest.php index 144288d..bcd06f7 100644 --- a/tests/Middleware/MiddlewareFactoryTest.php +++ b/tests/Middleware/MiddlewareFactoryTest.php @@ -179,7 +179,7 @@ public function testInvalidMiddlewareWithWrongArrayWithIntItems(): void $this->getMiddlewareFactory()->create([7, 42]); } - private function getMiddlewareFactory(ContainerInterface $container = null): MiddlewareFactoryInterface + private function getMiddlewareFactory(?ContainerInterface $container = null): MiddlewareFactoryInterface { $container = $container ?? $this->getContainer();