Skip to content

Commit

Permalink
chore: allow symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbrault committed Apr 9, 2024
1 parent 44ae175 commit 69be5eb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
32 changes: 16 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5",
"symfony/config": "^4.4 || ^5.4 || ^6.0",
"symfony/console": "^4.4 || ^5.4 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0",
"symfony/messenger": "^4.4 || ^5.4 || ^6.0",
"symfony/stopwatch": "^4.4 || ^5.4 || ^6.0",
"symfony/config": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/console": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/messenger": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/stopwatch": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symplify/easy-coding-standard": "^9.3"
},
"suggest": {
"symfony/config": "^4.4 || ^5.4 || ^6.0",
"symfony/console": "^4.4 || ^5.4 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0",
"symfony/messenger": "^4.4 || ^5.4 || ^6.0",
"symfony/stopwatch": "^4.4 || ^5.4 || ^6.0"
"symfony/config": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/console": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/messenger": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/stopwatch": "^4.4 || ^5.4 || ^6.0 || ^7.0"
},
"config": {
"preferred-install": "dist",
Expand Down
9 changes: 8 additions & 1 deletion src/EventListener/MessengerProfilerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ public function onReject(WorkerMessageFailedEvent $event): void
$throwable = $event->getThrowable();

if ($throwable instanceof HandlerFailedException) {
$nestedExceptions = $throwable->getNestedExceptions();
$nestedExceptions = [];

if (method_exists($throwable, 'getNestedExceptions')) {

Check failure on line 54 in src/EventListener/MessengerProfilerListener.php

View workflow job for this annotation

GitHub Actions / PHP 8.0 - Symfony 4.4

Call to function method_exists() with Symfony\Component\Messenger\Exception\HandlerFailedException and 'getNestedExceptions' will always evaluate to true.

Check failure on line 54 in src/EventListener/MessengerProfilerListener.php

View workflow job for this annotation

GitHub Actions / PHP 8.0 - Symfony 5.4

Call to function method_exists() with Symfony\Component\Messenger\Exception\HandlerFailedException and 'getNestedExceptions' will always evaluate to true.

Check failure on line 54 in src/EventListener/MessengerProfilerListener.php

View workflow job for this annotation

GitHub Actions / PHP 8.0 - Symfony 6.0

Call to function method_exists() with Symfony\Component\Messenger\Exception\HandlerFailedException and 'getNestedExceptions' will always evaluate to true.

Check failure on line 54 in src/EventListener/MessengerProfilerListener.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 - Symfony 4.4

Call to function method_exists() with Symfony\Component\Messenger\Exception\HandlerFailedException and 'getNestedExceptions' will always evaluate to true.

Check failure on line 54 in src/EventListener/MessengerProfilerListener.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 - Symfony 5.4

Call to function method_exists() with Symfony\Component\Messenger\Exception\HandlerFailedException and 'getNestedExceptions' will always evaluate to true.

Check failure on line 54 in src/EventListener/MessengerProfilerListener.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 - Symfony 6.0

Call to function method_exists() with Symfony\Component\Messenger\Exception\HandlerFailedException and 'getNestedExceptions' will always evaluate to true.

Check failure on line 54 in src/EventListener/MessengerProfilerListener.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 - Symfony 6.1

Call to function method_exists() with Symfony\Component\Messenger\Exception\HandlerFailedException and 'getNestedExceptions' will always evaluate to true.
$nestedExceptions = $throwable->getNestedExceptions();
} elseif (method_exists($throwable, 'getWrappedExceptions')) {
$nestedExceptions = $throwable->getWrappedExceptions();
}

$firstNestedException = reset($nestedExceptions);

$throwable = false !== $firstNestedException ? $firstNestedException : $throwable;
Expand Down

0 comments on commit 69be5eb

Please sign in to comment.