Skip to content

Commit dcc2178

Browse files
minor symfony#52483 Move CodeExtension from TwigBridge to WebProfilerBundle (nicolas-grekas)
This PR was merged into the 7.0 branch. Discussion ---------- Move CodeExtension from TwigBridge to WebProfilerBundle | Q | A | ------------- | --- | Branch? | 7.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT The class is internal in 7.0 so we can move it closer to where it's used. Commits ------- c0baaff Move CodeExtension from TwigBridge to WebProfilerBundle
2 parents 70bc6ff + c0baaff commit dcc2178

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Symfony/Bundle/TwigBundle/Resources/config/twig.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Bridge\Twig\ErrorRenderer\TwigErrorRenderer;
1818
use Symfony\Bridge\Twig\EventListener\TemplateAttributeListener;
1919
use Symfony\Bridge\Twig\Extension\AssetExtension;
20-
use Symfony\Bridge\Twig\Extension\CodeExtension;
2120
use Symfony\Bridge\Twig\Extension\ExpressionExtension;
2221
use Symfony\Bridge\Twig\Extension\HtmlSanitizerExtension;
2322
use Symfony\Bridge\Twig\Extension\HttpFoundationExtension;
@@ -106,10 +105,6 @@
106105
->set('twig.extension.assets', AssetExtension::class)
107106
->args([service('assets.packages')])
108107

109-
->set('twig.extension.code', CodeExtension::class)
110-
->args([service('debug.file_link_formatter')->ignoreOnInvalid(), param('kernel.project_dir'), param('kernel.charset')])
111-
->tag('twig.extension')
112-
113108
->set('twig.extension.routing', RoutingExtension::class)
114109
->args([service('router')])
115110

src/Symfony/Bridge/Twig/Extension/CodeExtension.php renamed to src/Symfony/Bundle/WebProfilerBundle/Profiler/CodeExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Bridge\Twig\Extension;
12+
namespace Symfony\Bundle\WebProfilerBundle\Profiler;
1313

1414
use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
1515
use Twig\Extension\AbstractExtension;
@@ -23,7 +23,7 @@
2323
*
2424
* @author Fabien Potencier <fabien@symfony.com>
2525
*
26-
* @internal since Symfony 6.4
26+
* @internal
2727
*/
2828
final class CodeExtension extends AbstractExtension
2929
{

src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Bundle\WebProfilerBundle\Controller\RouterController;
1717
use Symfony\Bundle\WebProfilerBundle\Csp\ContentSecurityPolicyHandler;
1818
use Symfony\Bundle\WebProfilerBundle\Csp\NonceGenerator;
19+
use Symfony\Bundle\WebProfilerBundle\Profiler\CodeExtension;
1920
use Symfony\Bundle\WebProfilerBundle\Twig\WebProfilerExtension;
2021
use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
2122
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
@@ -79,5 +80,9 @@
7980
'_profiler_open_file',
8081
'?file=%%f&line=%%l#line%%l',
8182
])
83+
84+
->set('twig.extension.code', CodeExtension::class)
85+
->args([service('debug.file_link_formatter'), param('kernel.project_dir'), param('kernel.charset')])
86+
->tag('twig.extension')
8287
;
8388
};

0 commit comments

Comments
 (0)