From 434f72009a76bfaf53e2b03902899f3e87df9160 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Fri, 24 Nov 2023 09:47:42 +0100 Subject: [PATCH] Allow PHP83 --- .github/workflows/grumphp.yaml | 4 ++-- composer.json | 16 ++++++++-------- .../JsonApiProblemExceptionListener.php | 4 ++-- test/Transformer/ChainTest.php | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/grumphp.yaml b/.github/workflows/grumphp.yaml index 45f4bc3..9db01a1 100644 --- a/.github/workflows/grumphp.yaml +++ b/.github/workflows/grumphp.yaml @@ -7,7 +7,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['8.0', '8.1', '8.2'] + php-versions: ['8.1', '8.2', '8.3'] composer-options: ['', '--prefer-lowest'] fail-fast: false name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} with ${{ matrix.composer-options }} @@ -39,4 +39,4 @@ jobs: - name: Run the tests run: php vendor/bin/grumphp run --no-interaction env: - PHP_CS_FIXER_IGNORE_ENV: 1 \ No newline at end of file + PHP_CS_FIXER_IGNORE_ENV: 1 diff --git a/composer.json b/composer.json index 3d3a97d..3e9a909 100644 --- a/composer.json +++ b/composer.json @@ -10,20 +10,20 @@ } ], "require": { - "php": "^8.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "phpro/api-problem": "^1.0", - "symfony/dependency-injection": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/http-kernel": "^5.4 || ^6.0" + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.13", + "friendsofphp/php-cs-fixer": "^3.39", "matthiasnoback/symfony-dependency-injection-test": "^4.3", - "phpro/grumphp-shim": "^1.14.0", + "phpro/grumphp-shim": "^2.3", "phpspec/prophecy-phpunit": "^2.0", - "phpspec/prophecy": "1.15", + "phpspec/prophecy": "^1.17", "phpunit/phpunit": "^9.5", - "symfony/security-core": "^5.4 || ^6.0" + "symfony/security-core": "^5.4 || ^6.0 || ^7.0" }, "config": { "sort-packages": true, diff --git a/src/EventListener/JsonApiProblemExceptionListener.php b/src/EventListener/JsonApiProblemExceptionListener.php index d2a1f78..3ca5ed1 100644 --- a/src/EventListener/JsonApiProblemExceptionListener.php +++ b/src/EventListener/JsonApiProblemExceptionListener.php @@ -35,8 +35,8 @@ public function onKernelException(ExceptionEvent $event): void { $request = $event->getRequest(); if ( - false === mb_strpos($request->getPreferredFormat(), 'json') && - false === mb_strpos((string) $request->getContentType(), 'json') + false === mb_strpos($request->getPreferredFormat(), 'json') + && false === mb_strpos((string) $request->getContentType(), 'json') ) { return; } diff --git a/test/Transformer/ChainTest.php b/test/Transformer/ChainTest.php index e5a8545..0add6d1 100644 --- a/test/Transformer/ChainTest.php +++ b/test/Transformer/ChainTest.php @@ -55,7 +55,7 @@ public function it_transforms_to_basic_exception_problem_when_no_transformer_mat $this->assertInstanceOf(ExceptionApiProblem::class, $transformer->transform(new Exception())); } - private function mockTransformer(bool $accepts, ?ApiProblemInterface $apiProblem = null): ExceptionTransformerInterface + private function mockTransformer(bool $accepts, ApiProblemInterface $apiProblem = null): ExceptionTransformerInterface { /** @var ExceptionTransformerInterface|ObjectProphecy $transformer */ $transformer = $this->prophesize(ExceptionTransformerInterface::class);