Skip to content

Commit 303e4e2

Browse files
committed
feature #36739 [TwigBundle] Deprecate the public "twig" service to private (fancyweb)
This PR was merged into the 5.2-dev branch. Discussion ---------- [TwigBundle] Deprecate the public "twig" service to private | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - I think the `twig` service don't need to be public anymore - we never need to access it directly in Symfony's code. Commits ------- f64cbada89 [TwigBundle] Deprecate the public "twig" service to private
2 parents 71bf50f + baa7f29 commit 303e4e2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Tests/Functional/BundlePathsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testBundlePublicDir()
4040
public function testBundleTwigTemplatesDir()
4141
{
4242
static::bootKernel(['test_case' => 'BundlePaths']);
43-
$twig = static::$container->get('twig');
43+
$twig = static::$container->get('twig.alias');
4444
$bundlesMetadata = static::$container->getParameter('kernel.bundles_metadata');
4545

4646
$this->assertSame([$bundlesMetadata['LegacyBundle']['path'].'/Resources/views'], $twig->getLoader()->getPaths('Legacy'));

Tests/Functional/app/BundlePaths/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ framework:
88

99
twig:
1010
strict_variables: '%kernel.debug%'
11+
12+
services:
13+
twig.alias:
14+
alias: twig
15+
public: true

0 commit comments

Comments
 (0)