Skip to content

Commit

Permalink
feat: add sentry-sdk ^4.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
WaylandAce committed Apr 13, 2024
1 parent 3b2b421 commit 793f268
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"require-dev": {
"symfony/var-dumper": "^6.0 || ^7.0",
"sentry/sentry-symfony": "^4.5",
"sentry/sentry-symfony": "^4.5 || ^5.0",
"symfony/framework-bundle": "^6.0 || ^7.0",
"nyholm/psr7": "^1.2",
"doctrine/mongodb-odm": "^2.2",
Expand Down
6 changes: 5 additions & 1 deletion src/Integration/Sentry/SentryMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ public function process(Request $request, HttpKernelInterface $next): \Iterator
yield $next->handle($request);
} finally {
$client = $this->hub->getClient();
$client?->flush()->wait(false);

$result = $client?->flush();
if (is_a($result, 'GuzzleHttp\Promise\PromiseInterface')) {

Check failure on line 31 in src/Integration/Sentry/SentryMiddleware.php

View workflow job for this annotation

GitHub Actions / Static analysis (PHP 8.1) (lowest dependencies)

Parameter #1 $object_or_class of function is_a expects object, GuzzleHttp\Promise\PromiseInterface|null given.

Check failure on line 31 in src/Integration/Sentry/SentryMiddleware.php

View workflow job for this annotation

GitHub Actions / Static analysis (PHP 8.1) (stable dependencies)

Parameter #1 $object_or_class of function is_a expects object, Sentry\Transport\Result|null given.

Check failure on line 31 in src/Integration/Sentry/SentryMiddleware.php

View workflow job for this annotation

GitHub Actions / Static analysis (PHP 8.2) (lowest dependencies)

Parameter #1 $object_or_class of function is_a expects object, GuzzleHttp\Promise\PromiseInterface|null given.

Check failure on line 31 in src/Integration/Sentry/SentryMiddleware.php

View workflow job for this annotation

GitHub Actions / Static analysis (PHP 8.2) (stable dependencies)

Parameter #1 $object_or_class of function is_a expects object, Sentry\Transport\Result|null given.
$result->wait(false);

Check failure on line 32 in src/Integration/Sentry/SentryMiddleware.php

View workflow job for this annotation

GitHub Actions / Static analysis (PHP 8.1) (stable dependencies)

Call to method wait() on an unknown class GuzzleHttp\Promise\PromiseInterface.

Check failure on line 32 in src/Integration/Sentry/SentryMiddleware.php

View workflow job for this annotation

GitHub Actions / Static analysis (PHP 8.2) (stable dependencies)

Call to method wait() on an unknown class GuzzleHttp\Promise\PromiseInterface.
}

$this->hub->popScope();
}
Expand Down

0 comments on commit 793f268

Please sign in to comment.