Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5c7cb56

Browse filesBrowse files
committed
bug #14859 Improve the config validation in TwigBundle (stof)
This PR was merged into the 2.3 branch. Discussion ---------- Improve the config validation in TwigBundle | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14858 | License | MIT | Doc PR | n/a This ensures we have better error messages in case of misconfiguration instead of having crappy errors from Twig (which does not validates its options fully either, missing these things) Commits ------- f4dfee3 Improve the config validation in TwigBundle
2 parents 5607f71 + f4dfee3 commit 5c7cb56
Copy full SHA for 5c7cb56

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ private function addTwigOptions(ArrayNodeDefinition $rootNode)
129129
->end()
130130
->scalarNode('autoescape_service')->defaultNull()->end()
131131
->scalarNode('autoescape_service_method')->defaultNull()->end()
132-
->scalarNode('base_template_class')->example('Twig_Template')->end()
132+
->scalarNode('base_template_class')->example('Twig_Template')->cannotBeEmpty()->end()
133133
->scalarNode('cache')->defaultValue('%kernel.cache_dir%/twig')->end()
134134
->scalarNode('charset')->defaultValue('%kernel.charset%')->end()
135-
->scalarNode('debug')->defaultValue('%kernel.debug%')->end()
136-
->scalarNode('strict_variables')->end()
135+
->booleanNode('debug')->defaultValue('%kernel.debug%')->end()
136+
->booleanNode('strict_variables')->end()
137137
->scalarNode('auto_reload')->end()
138-
->scalarNode('optimizations')->end()
138+
->integerNode('optimizations')->min(-1)->end()
139139
->arrayNode('paths')
140140
->normalizeKeys(false)
141141
->useAttributeAsKey('paths')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.