Skip to content

[TwigBundle] Remove legacy code #33476

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

Merged
merged 1 commit into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ public function registerContainerConfiguration(LoaderInterface $loader)
$loader->load(__DIR__.\DIRECTORY_SEPARATOR.'config.yml');
}

public function setAnnotatedClassCache(array $annotatedClasses)
{
$annotatedClasses = array_diff($annotatedClasses, ['Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController', 'Symfony\Bundle\TwigBundle\Controller\ExceptionController', 'Symfony\Bundle\TwigBundle\Controller\PreviewErrorController']);

parent::setAnnotatedClassCache($annotatedClasses);
}

protected function build(ContainerBuilder $container)
{
$container->register('logger', NullLogger::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ framework:

twig:
strict_variables: '%kernel.debug%'
exception_controller: null # to be removed in 5.0
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ framework:

twig:
strict_variables: '%kernel.debug%'
exception_controller: null # to be removed in 5.0
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
twig:
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
exception_controller: null # to be removed in 5.0
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/TwigBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ CHANGELOG
* removed support to load templates from the legacy directories `src/Resources/views/` and `src/Resources/<BundleName>/views/`
* removed `TwigEngine` class, use `Twig\Environment` instead
* removed `FilesystemLoader` and `NativeFilesystemLoader`, use Twig notation for templates instead
* updated default value for the `twig.exception_controller` option to `null`
* removed `ExceptionController` class and all built-in error templates in favor of the new error renderer mechanism
* removed `twig.exception_controller` configuration option, use `framework.error_controller` option instead
* removed `ExceptionController`, `PreviewErrorController` and all built-in error templates in favor of the new error renderer mechanism

4.4.0
-----
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder('twig');
$rootNode = $treeBuilder->getRootNode();

$rootNode
->children()
->scalarNode('exception_controller')
->defaultNull()
->end()
->end()
;

$this->addFormThemesSection($rootNode);
$this->addGlobalsSection($rootNode);
$this->addTwigOptions($rootNode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ public function load(array $configs, ContainerBuilder $container)

$config = $this->processConfiguration($configuration, $configs);

$container->setParameter('twig.exception_listener.controller', $config['exception_controller']);

$container->setParameter('twig.form.resources', $config['form_themes']);
$container->setParameter('twig.default_path', $config['default_path']);
$defaultTwigPath = $container->getParameterBag()->resolveValue($config['default_path']);
Expand Down
12 changes: 0 additions & 12 deletions src/Symfony/Bundle/TwigBundle/Resources/config/routing/errors.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<xsd:attribute name="charset" type="xsd:string" />
<xsd:attribute name="debug" type="xsd:string" />
<xsd:attribute name="strict-variables" type="xsd:string" />
<xsd:attribute name="exception-controller" type="xsd:string" />
<xsd:attribute name="default-path" type="xsd:string" />
</xsd:complexType>

Expand Down
21 changes: 0 additions & 21 deletions src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,6 @@
<argument type="service" id="workflow.registry" />
</service>

<service id="twig.exception_listener" class="Symfony\Component\HttpKernel\EventListener\ExceptionListener">
<tag name="kernel.event_subscriber" />
<tag name="monolog.logger" channel="request" />
<argument>%twig.exception_listener.controller%</argument>
<argument type="service" id="logger" on-invalid="null" />
<argument>%kernel.debug%</argument>
<deprecated>The "%service_id%" service is deprecated since Symfony 4.4.</deprecated>
</service>

<service id="twig.controller.exception" class="Symfony\Bundle\TwigBundle\Controller\ExceptionController" public="true">
<argument type="service" id="twig" />
<argument>%kernel.debug%</argument>
<deprecated>The "%service_id%" service is deprecated since Symfony 4.4.</deprecated>
</service>

<service id="twig.controller.preview_error" class="Symfony\Bundle\TwigBundle\Controller\PreviewErrorController" public="true">
<argument type="service" id="http_kernel" />
<argument>%twig.exception_listener.controller%</argument>
<deprecated>The "%service_id%" service is deprecated since Symfony 4.4.</deprecated>
</service>

<service id="twig.configurator.environment" class="Symfony\Bundle\TwigBundle\DependencyInjection\Configurator\EnvironmentConfigurator">
<argument /> <!-- date format, set in TwigExtension -->
<argument /> <!-- interval format, set in TwigExtension -->
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
'charset' => 'ISO-8859-1',
'debug' => true,
'strict_variables' => true,
'exception_controller' => null, // to be removed in 5.0
'default_path' => '%kernel.project_dir%/Fixtures/templates',
'paths' => [
'path1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/twig https://symfony.com/schema/dic/twig/twig-1.0.xsd">

<twig:config auto-reload="true" autoescape="true" base-template-class="stdClass" cache="/tmp" charset="ISO-8859-1" debug="true" strict-variables="true" exception-controller="null">
<twig:config auto-reload="true" autoescape="true" base-template-class="stdClass" cache="/tmp" charset="ISO-8859-1" debug="true" strict-variables="true">
<twig:path namespace="namespace3">namespaced_path3</twig:path>
</twig:config>
</container>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/twig https://symfony.com/schema/dic/twig/twig-1.0.xsd">

<twig:config auto-reload="true" autoescape="true" base-template-class="stdClass" cache="/tmp" charset="ISO-8859-1" debug="true" strict-variables="true" default-path="%kernel.project_dir%/Fixtures/templates" exception-controller="null">
<twig:config auto-reload="true" autoescape="true" base-template-class="stdClass" cache="/tmp" charset="ISO-8859-1" debug="true" strict-variables="true" default-path="%kernel.project_dir%/Fixtures/templates">
<twig:form-theme>MyBundle::form.html.twig</twig:form-theme>
<twig:global key="foo" id="bar" type="service" />
<twig:global key="baz">@@qux</twig:global>
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Bundle/TwigBundle/TwigBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Bundle\TwigBundle;

use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\ExceptionListenerPass;
use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\ExtensionPass;
use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\RuntimeLoaderPass;
use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\TwigEnvironmentPass;
Expand All @@ -35,7 +34,6 @@ public function build(ContainerBuilder $container)
$container->addCompilerPass(new ExtensionPass());
$container->addCompilerPass(new TwigEnvironmentPass());
$container->addCompilerPass(new TwigLoaderPass());
$container->addCompilerPass(new ExceptionListenerPass());
$container->addCompilerPass(new RuntimeLoaderPass(), PassConfig::TYPE_BEFORE_REMOVING);
}

Expand Down