Skip to content

Commit

Permalink
Fix BC issue with ExceptionLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
starred-gijs committed Apr 11, 2024
1 parent aaa8056 commit 75c9a6a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
tools: flex

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Download dependencies
run: |
Expand All @@ -40,7 +40,7 @@ jobs:
coverage: none

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Download dependencies
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: apcu, redis
coverage: none
tools: phpstan:1.6.8, cs2pr
tools: phpstan:1.10.66, cs2pr

- name: Download dependencies
uses: ramsey/composer-install@v1
Expand All @@ -29,12 +29,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: apcu, redis
coverage: none
tools: vimeo/psalm:4.30.0
Expand All @@ -51,12 +51,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
coverage: none
tools: php-cs-fixer:3.13, cs2pr

Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ parameters:
level: 5
paths:
- ./src
excludes_analyse:
excludePaths:
- ./vendor/
- ./tests/
4 changes: 2 additions & 2 deletions src/ExceptionLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public static function getSubscribedEvents()
];
}

public function onException(WorkerMessageFailedEvent $event)
public function onException(WorkerMessageFailedEvent $event): void
{
$envelope = $event->getEnvelope();
$throwable = $event->getThrowable();
$firstNestedException = null;
if ($throwable instanceof HandlerFailedException) {
$envelope = $throwable->getEnvelope();
$nestedExceptions = $throwable->getNestedExceptions();
$nestedExceptions = method_exists($throwable, 'getNestedExceptions') ? $throwable->getNestedExceptions() : $throwable->getWrappedExceptions();
$firstNestedException = $nestedExceptions[array_key_first($nestedExceptions)];
}

Expand Down

0 comments on commit 75c9a6a

Please sign in to comment.