Skip to content

Commit 0d644cd

Browse files
committed
"Enhance Configuration to handle type: disabled in normalization logic and tests."
1 parent f870fa2 commit 0d644cd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/TwigHooks/src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private function addHooksConfiguration(ArrayNodeDefinition $rootNode): void
7878
return $v;
7979
}
8080

81-
if (true === $isTypeDefined) {
81+
if (true === $isTypeDefined && false === $isDisabled) {
8282
return $v;
8383
}
8484

src/TwigHooks/tests/Integration/DependencyInjection/ConfigurationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public function testItThrowsExceptionWhenBothTemplateAndComponentShortcutsAreDef
174174
'some_hookable' => [
175175
'component' => 'MyAwesomeComponent',
176176
'template' => 'some_target.html.twig',
177+
'type' => 'disabled',
177178
],
178179
],
179180
],
@@ -193,6 +194,7 @@ public function testItThrowsExceptionWhenPropsAreDefinedForNonComponentHookable(
193194
'some_hookable' => [
194195
'template' => 'some_target.html.twig',
195196
'props' => ['key' => 'value'],
197+
'type' => 'disabled',
196198
],
197199
],
198200
],

0 commit comments

Comments
 (0)