Closed tibbsa closed 9 months ago
You're right that it's better to not use transitive dependencies and require them in the composer.json
directly. I had that in the past but removed it to reduce the size of the require
section. I will re-add it, thanks for bringing this up!
However, the guzzlehttp/psr7
dependency should be present, as it is included in guzzlehttp/guzzle
(https://github.com/guzzle/guzzle/blob/d95d9ab74822c2ca06b31477cd6775a4a299b8e8/composer.json#L57)
Could you replace the contents of your composer.json
file in the issue with the output of composer show
? (I updated the issue template to suggest this by default)
If guzzlehttp/psr7
is not in the list, please try a composer update -W guzzlehttp/guzzle
(or composer update -W
to update all dependencies) and see if that changes anything.
I will re-add it, thanks for bringing this up!
I will do this in the upcoming 8.0 release.
Yes, guzzlehttp/guzzle
has guzzlehttp/psr7
as a dependency, but guzzlehttp/guzzle
is more permissive and allows for "^1.9.1 || ^2.5.1"
, but you need to limit it to ^2.0 because HttpFactory
was only added in the 2.x branch.
Because I have another dependency that has pegged guzzlehttp/psr7
at ^1.9.1
, I have the 1.x branch installed in the project, so the dependency for guzzlehttp/guzzle
is satisfied but it does not actually provide what is needed for the Firebase package.
Ah, got it! Thanks for the clarification, I will do it in a new 7.x release then!
Implemented in https://github.com/kreait/firebase-php/commit/c9f7ef556032f61b66711207a4d9dd9e2f46de9d and released with https://github.com/kreait/firebase-php/releases/tag/7.7.0
Thanks again!
Describe the bug
While upgrading a project to Laravel 10, I ran into what I think is an undocumented dependency.
src/Firebase/Factory.php
usesGuzzleHttp\Psr7\HttpFactory
, but that doesn't appear to be a part of the "guzzlehttp/guzzlepackage (which is listed in
composer.json) and is instead a part of
guzzlehttp/psr7` (from v2.x upward).I ran into the issue because I have another dependency that currently hard-depends on
guzzlehttp/psr7:1.6
which silently preventedguzzlehttp/psr7:2.x
from being installed. While the upgrade 'succeeded', my Laravel notifications then failed because of the missingHttpFactory
class.If my understanding is right, then this is simply a matter of listing
guzzlehttp/psr7:^2.0
incomposer.json
for this project. That won't solve my current dependency conflict with the other package, but at least it would have flagged it as a problem earlier in the upgrade process.Installed packages
PHP version and extensions
Steps to reproduce the issue.
(see above)
Error message/Stack trace
Additional information
No response