Skip to content

Commit 2603af1

Browse files
committed
"Add PHPStan type annotations for Configuration methods and parameters to improve static analysis."
1 parent 0d644cd commit 2603af1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/TwigHooks/src/DependencyInjection/Configuration.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717
use Sylius\TwigHooks\Hookable\HookableComponent;
1818
use Sylius\TwigHooks\Hookable\HookableTemplate;
1919
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
20+
use Symfony\Component\Config\Definition\Builder\NodeParentInterface;
2021
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
2122
use Symfony\Component\Config\Definition\ConfigurationInterface;
2223

2324
final class Configuration implements ConfigurationInterface
2425
{
26+
/**
27+
* @phpstan-return TreeBuilder<'sylius_twig_hooks'>
28+
*/
2529
public function getConfigTreeBuilder(): TreeBuilder
2630
{
2731
$treeBuilder = new TreeBuilder('sylius_twig_hooks');
@@ -41,6 +45,9 @@ public function getConfigTreeBuilder(): TreeBuilder
4145
return $treeBuilder;
4246
}
4347

48+
/**
49+
* @phpstan-param ArrayNodeDefinition<NodeParentInterface|null> $rootNode
50+
*/
4451
private function addSupportedHookableTypesConfiguration(ArrayNodeDefinition $rootNode): void
4552
{
4653
$rootNode
@@ -58,6 +65,9 @@ private function addSupportedHookableTypesConfiguration(ArrayNodeDefinition $roo
5865
;
5966
}
6067

68+
/**
69+
* @phpstan-param ArrayNodeDefinition<NodeParentInterface|null> $rootNode
70+
*/
6171
private function addHooksConfiguration(ArrayNodeDefinition $rootNode): void
6272
{
6373
$rootNode

0 commit comments

Comments
 (0)