From e2fd5ee6e8ec380bbfeaa91ba319c250628a4e75 Mon Sep 17 00:00:00 2001 From: sakulb <95277083+sakulb@users.noreply.github.com> Date: Wed, 3 Jan 2024 11:49:38 +0100 Subject: [PATCH] Symfony 7 compatibility. (#28) Updated psalm. Minimal required PHP version is now 8.2. --- .github/workflows/php.yml | 4 +--- Tests/Transport/GpsConfigurationTest.php | 2 +- Tests/Transport/GpsTransportFactoryTest.php | 2 +- Tests/Transport/GpsTransportTest.php | 4 ++-- Transport/GpsTransportFactory.php | 1 + composer.json | 16 ++++++++-------- psalm.xml | 2 ++ 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c293190..2f72384 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,10 +10,8 @@ jobs: strategy: matrix: php-version: - - '7.4' - - '8.0' - - '8.1' - '8.2' + - '8.3' platform: [ubuntu-latest] name: PHP ${{ matrix.php-version }} runs-on: ubuntu-latest diff --git a/Tests/Transport/GpsConfigurationTest.php b/Tests/Transport/GpsConfigurationTest.php index a702a75..15d1686 100644 --- a/Tests/Transport/GpsConfigurationTest.php +++ b/Tests/Transport/GpsConfigurationTest.php @@ -31,7 +31,7 @@ public function testResolve(string $dsn, array $options, GpsConfigurationInterfa $this->assertEquals($expectedConfiguration, $configuration); } - public function dataProvider(): array + public static function dataProvider(): array { return [ 'Empty default' => [ diff --git a/Tests/Transport/GpsTransportFactoryTest.php b/Tests/Transport/GpsTransportFactoryTest.php index e721b25..ca706ee 100644 --- a/Tests/Transport/GpsTransportFactoryTest.php +++ b/Tests/Transport/GpsTransportFactoryTest.php @@ -29,7 +29,7 @@ public function testSupports(bool $expected, string $dsn): void $this->assertSame($expected, $this->subject->supports($dsn, [])); } - public function dsnProvider(): array + public static function dsnProvider(): array { return [ [true, 'gps://defaults/messages?client_config[apiEndpoint]=0.0.0.0:8432'], diff --git a/Tests/Transport/GpsTransportTest.php b/Tests/Transport/GpsTransportTest.php index 1baab2c..16ac378 100644 --- a/Tests/Transport/GpsTransportTest.php +++ b/Tests/Transport/GpsTransportTest.php @@ -63,7 +63,7 @@ public function testGet(): void public function testAck(): void { $this->expectException(TransportException::class); - $this->expectErrorMessage('No GpsReceivedStamp found on the Envelope.'); + $this->expectExceptionMessage('No GpsReceivedStamp found on the Envelope.'); $this->subject->ack(new Envelope(new stdClass())); } @@ -71,7 +71,7 @@ public function testAck(): void public function testReject(): void { $this->expectException(TransportException::class); - $this->expectErrorMessage('No GpsReceivedStamp found on the Envelope.'); + $this->expectExceptionMessage('No GpsReceivedStamp found on the Envelope.'); $this->subject->reject(new Envelope(new stdClass())); } diff --git a/Transport/GpsTransportFactory.php b/Transport/GpsTransportFactory.php index 41e99e6..a342e73 100644 --- a/Transport/GpsTransportFactory.php +++ b/Transport/GpsTransportFactory.php @@ -12,6 +12,7 @@ /** * @author Ronald Marfoldi + * @implements TransportFactoryInterface */ final class GpsTransportFactory implements TransportFactoryInterface { diff --git a/composer.json b/composer.json index 7f5dadd..512765d 100644 --- a/composer.json +++ b/composer.json @@ -20,20 +20,20 @@ } ], "require": { - "php": ">=7.4.0", + "php": ">=8.2", "ext-json": "*", "psr/cache": "^1.0|^2.0|^3.0", - "symfony/config": "^4.4|^5.1|^6.0", - "symfony/dependency-injection": "^4.4|^5.1|^6.0", - "symfony/http-kernel": "^4.4|^5.1|^6.0", - "symfony/messenger": "^4.4|^5.1|^6.0", - "symfony/options-resolver": "^4.4|^5.1|^6.0", + "symfony/config": "^5.1|^6.0|^7.0", + "symfony/dependency-injection": "^5.1|^6.0|^7.0", + "symfony/http-kernel": "^5.1|^6.0|^7.0", + "symfony/messenger": "^5.1|^6.0|^7.0", + "symfony/options-resolver": "^5.1|^6.0|^7.0", "google/cloud-pubsub": "^1.29" }, "require-dev": { "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^4.26", - "symfony/yaml": "^4.4|^5.1|^6.0", + "vimeo/psalm": "^5.0", + "symfony/yaml": "^5.1|^6.0|^7.0", "symplify/easy-coding-standard": "^11.1" }, "autoload": { diff --git a/psalm.xml b/psalm.xml index e112ec4..9cb449f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -5,6 +5,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" + findUnusedCode="false" + findUnusedBaselineEntry="false" >