-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[WIP] Allow Twig 3 #5973
[WIP] Allow Twig 3 #5973
Conversation
e9b99a7
to
59227c3
Compare
We could try to move |
Could you please rebase your PR and fix merge conflicts? |
ad4c1ab
to
36aeaa5
Compare
I think if using the new behavior is opt-in, then it's ok to have it in the stable branch. It's ok to deprecate the old behavior in favor of a new one if you don't force it on people. They will be more happy to see it clearly in a minor than have it non-obvious, in the middle of other things in a big major. |
Great proposal. I'll be working on that path. |
Could you please rebase your PR and fix merge conflicts? |
What's the status of this? Should it be reviewed or is it too soon? I see there is an unchecked checkbox in the todo list |
We need to decide what to do with "sonata-project/intl-bundle", since it provides some helper functions over the basic Intl features (#5975 (comment)). /cc @franmomu. |
I was thinking... what about to not deprecate the bundle? It could be updated using To me, it looks more like it should belong to a separated package instead of the AdminBundle one. |
I agree @franmomu. public function getTimezone()
{
if (!($token = $this->securityContext->getToken()) || !is_object($user = $token->getUser())) {
return null;
}
if ($user instanceof 'Sonata\UserBundle\Model\User') {
return $user->getTimezone();
}
$ro = new \ReflectionObject($user);
if ($ro->hasMethod('getTimezone')) {
$rm = $ro->getMethod('getTimezone');
if ($rm->isPublic() && !$rm->isStatic() && 0 === $rm->getNumberOfRequiredParameters()) {
return $user->getTimezone();
}
}
return null;
} But I'd prefer to declare a WDYT? |
Exactly, I think this is the best way to deal with sonata/intl-bundle right now. |
We need to make the required changes at "sonata-project/intl-bundle". I had no time these weeks. |
Seems like a discussion about the status of the @sonata-project/contributors ? If it's not deprecated anymore, we should start by updating the bundle description. |
Could you please rebase your PR and fix merge conflicts? |
I think you can close this PR @phansys, isn't it ? |
Yes, I guess. Closing. |
Subject
Allow Twig 3.
I am targeting this branch, because these changes can not be done at the stable branch.
Related to #5788, symfony/symfony#35649.
Changelog
To do
StringExtension
is the same asTextExtension
;Wait for the removal of "sonata-project/intl-bundle".When symfony/symfony#35649 is available in a stable release, we need to remove some of the stuff added in this PR and bump "symfony/string" to the version which ships them.
Regarding the Twig
truncate
filter, I had to make some slight modifications at test assertions since the new behavior differs a little bit from the previous one. Plus, I renamed "preserve" option to "cut", in order to be consistent with the term used at the String component (which also has the opposite behavior than "preserve").In this way, I think we should deprecate the "preserve" option at the stable branch.