Skip to content

Deprecate Kernel::stripComments() #51712

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

Conversation

alamirault
Copy link
Contributor

@alamirault alamirault commented Sep 21, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Tickets Fix #...
License MIT
Doc PR symfony/symfony-docs#...

This PR replace method_exists by class_exists in order to check if component is available. It harmonize codebase

This PR remove checking if method Kernel::setIgnore exists.

This method was introduced in symfony 2.3 (#18048), so now it's always available

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

The DI component can be used without the HttpKernel component, so this check is still relevant!

@alamirault
Copy link
Contributor Author

Hum, I understand now !
But shouldn't we use class_exists instead ? Like is done in codebase ?

@derrabus
Copy link
Member

We could do that, yes.

@alamirault alamirault requested a review from derrabus September 22, 2023 09:10
@stof
Copy link
Member

stof commented Sep 22, 2023

given that this method is not used anywhere in the HttpKernel component and does not depend on anything else in the component (its only dependency is token_get_all), maybe we should copy it in the PhpDumper of the DI component as a private method and deprecate the Kernel method.

@alamirault alamirault force-pushed the feature/remove-method-exists-Kernel-stripComments branch from 148a7fe to 4b7bdd6 Compare September 22, 2023 17:04
@alamirault alamirault changed the title [DependencyInjection] Remove checking if Kernel stripComment` method exists [DependencyInjection] Deprecate Kernel::stripComments() Sep 22, 2023
@alamirault alamirault changed the title [DependencyInjection] Deprecate Kernel::stripComments() [HttpKernel] Deprecate Kernel::stripComments() Sep 22, 2023
@alamirault
Copy link
Contributor Author

I deprecated method in Kernel and created a private in PhpDumper

@alamirault alamirault requested a review from stof September 23, 2023 08:57
@carsonbot carsonbot changed the title [HttpKernel] Deprecate Kernel::stripComments() Deprecate Kernel::stripComments() Sep 23, 2023
@fabpot fabpot force-pushed the feature/remove-method-exists-Kernel-stripComments branch from 15ac150 to 43c5038 Compare September 24, 2023 12:10
@fabpot
Copy link
Member

fabpot commented Sep 24, 2023

Thank you @alamirault.

@fabpot fabpot merged commit 0d344e1 into symfony:6.4 Sep 24, 2023
@alamirault alamirault deleted the feature/remove-method-exists-Kernel-stripComments branch September 24, 2023 18:39
@nicolas-grekas nicolas-grekas added this to the 6.4 milestone Sep 25, 2023
This was referenced Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants