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

Handle deprecations from Symfony 5.1 #3589

Merged

Conversation

derrabus
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

This PR addresses method signatures of the Symfony Config and DependencyInjection components that have changed in Symfony 5.1.

@derrabus derrabus force-pushed the bugfix/symfony-5.1-deprecations branch from d2cd906 to c163d51 Compare May 31, 2020 14:14
@@ -18,7 +18,6 @@
<service id="api_platform.operation_method_resolver" class="ApiPlatform\Core\Bridge\Symfony\Routing\OperationMethodResolver" public="false">
<argument type="service" id="api_platform.router" />
<argument type="service" id="api_platform.metadata.resource.metadata_factory" />
<deprecated>The "%service_id%" service is deprecated since API Platform 2.5.</deprecated>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 I haven't found a way to produce an XML file that can be loaded with DependencyInjection 4.4 and 5.1 without errors:

  • DI 5.1 triggers a deprecation if the attributes package and version are missing.
  • DI 4.4 throws an exception, if those attributes are present.

This is why I'm deprecating the services inside the extension now.

@derrabus derrabus force-pushed the bugfix/symfony-5.1-deprecations branch from c163d51 to 592dede Compare May 31, 2020 14:33
@alanpoulain alanpoulain merged commit 6120226 into api-platform:2.5 Jun 4, 2020
@alanpoulain
Copy link
Member

Thank you very much @derrabus!

@derrabus derrabus deleted the bugfix/symfony-5.1-deprecations branch June 4, 2020 18:13
soyuka pushed a commit to soyuka/core that referenced this pull request Jun 15, 2020
@filisko
Copy link

filisko commented Jul 6, 2020

Hi everyone, I still get the error with api-platform/core v2.5.6. Do you know why could it be?

  5x: Since symfony/dependency-injection 5.1: Not setting the attribute "version" of the node "deprecated" in "/project/vendor/api-platform/core/src/Bridge/Symfony/Bundle/DependencyInjection/../Resources/config/api.xml" is deprecated.

  5x: Since symfony/dependency-injection 5.1: Not setting the attribute "package" of the node "deprecated" in "/project/vendor/api-platform/core/src/Bridge/Symfony/Bundle/DependencyInjection/../Resources/config/api.xml" is deprecated.

  4x: Since symfony/config 5.1: The signature of method "Symfony\Component\Config\Definition\Builder\NodeDefinition::setDeprecated()" requires 3 arguments: "string $package, string $version, string $message", not defining them is deprecated.

  1x: Since symfony/dependency-injection 5.1: Not setting the attribute "package" of the node "deprecated" in "/project/vendor/api-platform/core/src/Bridge/Symfony/Bundle/DependencyInjection/../Resources/config/filter.xml" is deprecated.

  1x: Since symfony/dependency-injection 5.1: Not setting the attribute "version" of the node "deprecated" in "/project/vendor/api-platform/core/src/Bridge/Symfony/Bundle/DependencyInjection/../Resources/config/filter.xml" is deprecated.

@stloyd
Copy link
Contributor

stloyd commented Jul 6, 2020

Cause this was not yet released: v2.5.6...2.5

@filisko
Copy link

filisko commented Jul 6, 2020

Oh sorry, i don't know why i thought that because it is merged is released... Thank you @stloyd !!
Do you know when it would be released? 🤔

@soyuka
Copy link
Member

soyuka commented Jul 17, 2020

Summer and holidays are making things to move at slow pace, bear with us :)

@alebedev80
Copy link
Contributor

When do you plan to release it?

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

Successfully merging this pull request may close these issues.

None yet

6 participants