diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 650fffe..f1f067b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: tools: flex - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Download dependencies run: | @@ -40,7 +40,7 @@ jobs: coverage: none - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Download dependencies run: | diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 0f6011d..166a978 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -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 @@ -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 @@ -51,7 +51,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index cfd778d..d39b7c1 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,6 +2,6 @@ parameters: level: 5 paths: - ./src - excludes_analyse: + excludePaths: - ./vendor/ - ./tests/ diff --git a/src/ExceptionLogger.php b/src/ExceptionLogger.php index ff684c0..1359d53 100644 --- a/src/ExceptionLogger.php +++ b/src/ExceptionLogger.php @@ -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)]; }