Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'GuzzleHttp\Psr7\Utils' not found #12

Closed
gemal opened this issue Oct 8, 2020 · 12 comments
Closed

Class 'GuzzleHttp\Psr7\Utils' not found #12

gemal opened this issue Oct 8, 2020 · 12 comments

Comments

@gemal
Copy link

gemal commented Oct 8, 2020

image

loco/loco/src/Http/Request/BodyLocation.php

@timwhitlock
Copy link
Member

Guzzle\Psr7\stream_for is deprecated although admittedly not until 2.0 which my library will probably never depend on.

My question is why you don't you have Guzzle\Psr7\Utils::streamFor available after doing your composer update?

The composer dependency graph looks like this:

├──guzzlehttp/guzzle-services ^1.1
│  ├──guzzlehttp/guzzle ^6.2
│  │  ├──guzzlehttp/psr7 ^1.6.1

That leaves me with guzzlehttp/psr7 v1.7.0 installed. What version do you have?

@timwhitlock
Copy link
Member

Looks like GuzzleHttp\Psr7\Utils is in the v1.7.0 release, but is not present on master, I guess because there is a 1.x branch. I can only presume that the master branch will be version 2, but whatever the reason I'd like to know why my composer.json doesn't provide the correct version.

Let me know on that. In the mean time I've reverted my master branch to the deprecated function.

@gemal
Copy link
Author

gemal commented Oct 8, 2020

not sure how to find it
my Vendor\guzzlehttp\psr7\composer.json says

    "extra": {
        "branch-alias": {
            "dev-master": "1.6-dev"
        }
    } 

if not that how can I find the info you need

@timwhitlock
Copy link
Member

Just do composer show -i | grep guzzlehttp

@timwhitlock
Copy link
Member

I guess the bottom line here is that if guzzlehttp/guzzle depends on guzzlehttp/psr7 ^1.6.1 then my library can't guarantee you have 1.7. Possibly you have something else installed that requires a lower maximum version.

I'll make sure the next release uses the old, deprecated function. In the mean time you can either track the master or roll back to 2.0.7 of this library.

@gemal
Copy link
Author

gemal commented Oct 8, 2020

guzzlehttp/guzzle 6.5.5 Guzzle is a PHP HTTP client library
guzzlehttp/guzzle-services 1.1.3 Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to ...
guzzlehttp/promises v1.3.1 Guzzle promises library
guzzlehttp/psr7 1.6.1 PSR-7 message implementation that also provides common utility methods

@timwhitlock
Copy link
Member

Ok, well with guzzle-services 1.1.3 (which you have) you should get guzzlehttp/psr7 1.7.0 when you do a composer update unless some other library is constraining this to a lower version. Is this the case? Have you done an update?

Anyway, I've rolled the change back in master and have no plans to re-instate it.

@gemal
Copy link
Author

gemal commented Dec 16, 2020

@timwhitlock could you make a new release with the already commited "fix" included?

timwhitlock pushed a commit that referenced this issue Dec 16, 2020
@gemal
Copy link
Author

gemal commented Dec 16, 2020

thank you!

@digitv
Copy link
Contributor

digitv commented Feb 22, 2022

Hi! With latest version (at the moment 2.0.10) this problem reproduces, Guzzle packages versions are below

guzzlehttp/guzzle                7.4.1      Guzzle is a PHP HTTP client library
guzzlehttp/guzzle-services       1.3.1      Provides an implementation of the Guzzle Command library...
guzzlehttp/promises              1.5.1      Guzzle promises library
guzzlehttp/psr7                  2.1.0      PSR-7 message implementation that also provides common utility methods

Please roll-up a new version with this fix, besides "dev-master" works as expected.

@timwhitlock
Copy link
Member

Yeh, this dependency has proved to be a real pain. Maybe @gemal could confirm that the fix now on master is working for his use case also?

@timwhitlock timwhitlock reopened this Feb 22, 2022
@gemal
Copy link
Author

gemal commented Feb 28, 2022

I have not gotten any problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants