[1.x] Allow using namespaced aliases as extension names#2490
[1.x] Allow using namespaced aliases as extension names#2490fabpot merged 1 commit intotwigphp:1.xfrom
Conversation
|
Actually, can you add a unit test covering this ? |
|
test added |
|
Now with some |
test/Twig/Tests/EnvironmentTest.php
Outdated
| */ | ||
|
|
||
| require_once dirname(__FILE__).'/FilesystemHelper.php'; | ||
| require_once __DIR__.'/FilesystemHelper.php'; |
There was a problem hiding this comment.
Should be reverted. Even if you're right here, I prefer to not upgrade the code to 5.3+ in 1.x. It has been done in 2.x and I don't want people starting to send random PR about such changes :)
There was a problem hiding this comment.
haha, who should I fallow? fabpot or fabbot?
|
Do we actually need these require_once everywhere ? |
|
Yes. That's what symfony/symfony#22962 allowed me to spot. |
|
renamed |
| public function setLoader(Twig_LoaderInterface $loader) | ||
| { | ||
| if (!$loader instanceof Twig_SourceContextLoaderInterface && 0 !== strpos(get_class($loader), 'Mock_Twig_LoaderInterface')) { | ||
| if (!$loader instanceof Twig_SourceContextLoaderInterface && 0 !== strpos(get_class($loader), 'Mock_')) { |
There was a problem hiding this comment.
Mock_Twig_LoaderInterface vs Mock_LoaderInterface when sing the namespaced variant
looking for mock_ is enough IMHO
|
Now with aliases that were missing for Twig_Extension_InitRuntimeInterface, Twig_Extension_GlobalsInterface, Twig_SourceContextLoaderInterface and Twig_ExistsLoaderInterface PR should be ready. |
|
Thank you @nicolas-grekas. |
…colas-grekas) This PR was merged into the 1.x branch. Discussion ---------- [1.x] Allow using namespaced aliases as extension names Commits ------- c9a2f3d [1.x] Allow using namespaced aliases as extension names
|
@fabpot why reverted |
|
After trying to use the new class, it felt wrong. |
This PR was merged into the 2.7 branch. Discussion ---------- Use namespaced Twig | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | needs twigphp/Twig#2490 and twigphp/Twig#2491 | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- c3d1262 Use namespaced Twig
This PR was merged into the 1.x branch. Discussion ---------- Update .php_cs.dist following #2490 (comment) :) Commits ------- 8539a18 Update .php_cs.dist
No description provided.