Skip to content

Commit

Permalink
Merge pull request #27 from cached/master
Browse files Browse the repository at this point in the history
Update configuration.php to support Symfony 5
  • Loading branch information
toooni authored Nov 7, 2020
2 parents c5f97d8 + 9659098 commit b5936ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DataCollector/TwigCacheCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TwigCacheCollector implements DataCollectorInterface
*/
private $hits = 0;

public function collect(Request $request, Response $response, \Exception $exception = null)
public function collect(Request $request, Response $response, \Throwable $exception = null)
{
// nothing to do here
}
Expand Down
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('twig_cache');
$treeBuilder = new TreeBuilder('twig_cache', 'array');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('twig_cache', 'array');
}

$rootNode
->children()
Expand Down

0 comments on commit b5936ff

Please sign in to comment.