getsentry / sentry-laravel

The official Laravel SDK for Sentry (sentry.io)
https://sentry.io
MIT License
1.25k stars 189 forks source link

Dependency nyholm/psr7 can be defined like require-dev #868

Closed h4kuna closed 7 months ago

h4kuna commented 7 months ago

Problem Statement

I want to remove nyholm/psr7 from my project, if I search for dependencies, composer shows me sentry. Out of curiosity, I looked to see what it was used for. It is now only used in tests.

Solution Brainstorm

It will probably be necessary to add dependencies on PSR and describe in the documentation what to download (guzzle, nyholm, symfony). And add info to suggest.

"require": {
  "psr/http-message": "^1.1 | ^2.0",
  "psr/http-factory": "^1.0"
},
"require-dev": {
  "nyholm/psr7": "^1.0"
}
stayallive commented 7 months ago

The requirement is required by us because it's required by Laravel to obtain a PSR request object. That's why we have it required because we need a PSR version of the request object.

So your proposed solution will not work unfortunately since Laravel requires the Nyholm package to conjur the PSR request object!

See: https://github.com/laravel/framework/blob/08acc925f1ec8e1c41a54774a36720f506c5b5a8/src/Illuminate/Routing/RoutingServiceProvider.php#L127-L154