Skip to content

Commit 57db8a6

Browse files
authored
Merge pull request #302 from ruudk/remove-twig
Only require Twig when profiler is enabled
2 parents e7ed6a7 + ad15ab4 commit 57db8a6

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## 1.15.0 [unreleased]
6+
7+
### Changed
8+
9+
- Removed `twig/twig` dependency
10+
511
## 1.14.0
612

713
### Added

DependencyInjection/HttplugExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ public function load(array $configs, ContainerBuilder $container)
7676
->getDefinition('httplug.formatter.full_http_message')
7777
->addArgument($config['profiling']['captured_body_length'])
7878
;
79+
80+
if (!class_exists(\Twig_Environment::class)) {
81+
$container->removeDefinition('httplug.collector.twig.http_message');
82+
}
7983
}
8084

8185
$this->configureClients($container, $config);

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
"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",
3232
"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",
3333
"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"
3635
},
3736
"require-dev": {
3837
"guzzlehttp/psr7": "^1.0",
@@ -50,12 +49,14 @@
5049
"symfony/phpunit-bridge": "^3.4 || ^4.2",
5150
"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",
5251
"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"
5454
},
5555
"conflict": {
5656
"php-http/guzzle6-adapter": "<1.1"
5757
},
5858
"suggest": {
59+
"twig/twig": "Add this to your require-dev section when using the WebProfilerBundle",
5960
"php-http/mock-client": "Add this to your require-dev section to mock HTTP responses easily"
6061
},
6162
"autoload": {

0 commit comments

Comments
 (0)