Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SF4.4 - should implement method HttpClientInterface::withOptions(array $options) #40975

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

Closed
spipu opened this issue Apr 28, 2021 · 5 comments
Closed

Comments

@spipu
Copy link

spipu commented Apr 28, 2021

Symfony version(s) affected: 4.4.21

Description
when executing my Functional tests:

1x: Class "Symfony\Component\HttpClient\TraceableHttpClient" should implement method "Symfony\Contracts\HttpClient\HttpClientInterface::withOptions(array $options)": Returns a new instance of the client with new default options

How to reproduce
instance any http client in sf 4.4.21

Possible Solution
back port the fix that has be done in 5.3

Additional context
#40893

@jderusse
Copy link
Member

This is a new feature that will be implemented in symfony 5.3.

The 4.4 version of symfony/http-client requires contract 2.x which DOES NOT have this method.
BUT, but to provide a migration path for contract 2.x to 3.x we use an annotation on the interface to tell maintainers they have to implement this method if they want to be compatible with contract 3.x this is why you have the deprecation.

You should use "direct deprecation" flag (https://symfony.com/doc/current/components/phpunit_bridge.html#direct-and-indirect-deprecations) to only deal with deprecations triggered by your code.

@stof
Copy link
Member

stof commented Apr 28, 2021

@jderusse the webprofiler will still show such deprecation in all projects using 4.4

@spipu
Copy link
Author

spipu commented Apr 28, 2021

maybe the pb is more in the sf detection of deprecated, here :
https://github.com/symfony/error-handler/blob/5.x/DebugClassLoader.php#L473

normally it may ignore deprecation for the same vendor, but it does not seems to work

@dspiegel
Copy link

Seeing same issue with new project create with --version=LTS and existing 4.4 LTS applications. I would not expect to see any deprecation's from base LTS project. This same warning is now causing Jenkins build errors for our 4.4 LTS production builds but we are unable to fix as issue is with symphony packages. IMHO Symfony 5.x changes or updates should never affect current LTS code set. 5.x is development/Beta, not LTS.
Kind regards, Dave Spiegel

derrabus added a commit that referenced this issue May 3, 2021
… for `Symfony\*` classes unless symfony/symfony is being tested (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Skip "same vendor" ``@method`` deprecations for `Symfony\*` classes unless symfony/symfony is being tested

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | ref #40975 #40996 #40893
| License       | MIT
| Doc PR        |

Replaces #41001

Commits
-------

7a1a910 [ErrorHandler] Skip "same vendor" ``@method`` deprecations for `Symfony\*` classes unless symfony/symfony is being tested
@chalasr
Copy link
Member

chalasr commented May 4, 2021

Fixed in #41075.

@chalasr chalasr closed this as completed May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants