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

Move some static extension methods to non-static #4044

Merged
merged 1 commit into from May 1, 2024

Conversation

fabpot
Copy link
Contributor

@fabpot fabpot commented Apr 19, 2024

A first step to resolve #4040

{
if (null === $format) {
$formats = $env->getExtension(self::class)->getDateFormat();
$formats = $this->getDateFormat();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main idea is to remove the usage of $env when possible so that we can extract these methods to another class that would be available for public consumption.

@fabpot fabpot changed the title Move some static extension methods to non-static [WIP] Move some static extension methods to non-static Apr 19, 2024
src/Extension/CoreExtension.php Outdated Show resolved Hide resolved
extra/intl-extra/IntlExtension.php Outdated Show resolved Hide resolved
@fabpot fabpot force-pushed the less-static-methods branch 5 times, most recently from 2920b39 to b2433c3 Compare May 1, 2024 09:04
@fabpot fabpot changed the title [WIP] Move some static extension methods to non-static Move some static extension methods to non-static May 1, 2024
@fabpot fabpot force-pushed the less-static-methods branch 2 times, most recently from fbcc8cb to c654232 Compare May 1, 2024 11:47
@fabpot fabpot merged commit 1e75ff9 into twigphp:3.x May 1, 2024
65 of 77 checks passed
@fabpot fabpot deleted the less-static-methods branch May 1, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Twig functions becoming internal
3 participants