File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 7
7
use Http \Message \CookieJar ;
8
8
use Http \Message \Formatter ;
9
9
use Http \Message \StreamFactory ;
10
+ use InvalidArgumentException ;
10
11
use Psr \Cache \CacheItemPoolInterface ;
11
12
use Psr \Log \LoggerInterface ;
12
13
use Symfony \Component \Config \Definition \Builder \ArrayNodeDefinition ;
@@ -137,6 +138,16 @@ public function getConfigTreeBuilder()
137
138
->booleanNode ('enabled ' )
138
139
->info ('Turn the toolbar on or off. Defaults to kernel debug mode. ' )
139
140
->defaultValue ($ this ->debug )
141
+ ->validate ()
142
+ ->ifTrue ()
143
+ ->then (function ($ v ) {
144
+ if (!class_exists (\Twig_Environment::class)) {
145
+ throw new InvalidArgumentException ('Twig needs to be installed when enabling the profiler. ' );
146
+ }
147
+
148
+ return $ v ;
149
+ })
150
+ ->end ()
140
151
->end ()
141
152
->scalarNode ('formatter ' )->defaultNull ()->end ()
142
153
->integerNode ('captured_body_length ' )
Original file line number Diff line number Diff line change 31
31
"symfony/dependency-injection" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" ,
32
32
"symfony/event-dispatcher" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" ,
33
33
"symfony/http-kernel" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" ,
34
- "symfony/options-resolver" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" ,
35
- "twig/twig" : " ^1.36 || ^2.6"
34
+ "symfony/options-resolver" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1"
36
35
},
37
36
"require-dev" : {
38
37
"guzzlehttp/psr7" : " ^1.0" ,
50
49
"symfony/phpunit-bridge" : " ^3.4 || ^4.2" ,
51
50
"symfony/stopwatch" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" ,
52
51
"symfony/twig-bundle" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" ,
53
- "symfony/web-profiler-bundle" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1"
52
+ "symfony/web-profiler-bundle" : " ^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" ,
53
+ "twig/twig" : " ^1.36 || ^2.6"
54
54
},
55
55
"conflict" : {
56
56
"php-http/guzzle6-adapter" : " <1.1"
57
57
},
58
58
"suggest" : {
59
- "php-http/mock-client" : " Add this to your require-dev section to mock HTTP responses easily"
59
+ "php-http/mock-client" : " Add this to your require-dev section to mock HTTP responses easily" ,
60
+ "twig/twig" : " Add this to your require-dev section if you want to use the Symfony Profiler"
60
61
},
61
62
"autoload" : {
62
63
"psr-4" : {
You can’t perform that action at this time.
0 commit comments