Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Remove deprecation notice in PHP 8.1 (#357)
Browse files Browse the repository at this point in the history
Adds a `TreeBuilder` return type
  • Loading branch information
spackmat authored Jul 28, 2022
1 parent ecea502 commit 7588970
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@ class Configuration implements ConfigurationInterface
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('lexik_form_filter');

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

$rootNode
return (new TreeBuilder('lexik_form_filter'))->getRootNode()
->children()
->arrayNode('listeners')
->addDefaultsIfNotSet()
Expand Down Expand Up @@ -67,8 +58,7 @@ public function getConfigTreeBuilder()
->info('Encoding for case insensitive LIKE comparisons.')
->defaultNull()
->end()
->end();

return $treeBuilder;
->end()
->end();
}
}

0 comments on commit 7588970

Please sign in to comment.