Skip to content

Commit 038c50c

Browse files
authored
Merge pull request #833 from garak/fix-nullable-config
page_limit config must accept null
2 parents d6474ee + ae78849 commit 038c50c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ public function getConfigTreeBuilder(): TreeBuilder
4949
->scalarNode('page_range')
5050
->defaultValue(5)
5151
->end()
52-
->integerNode('page_limit')
52+
->scalarNode('page_limit')
5353
->defaultNull()
54+
->validate()
55+
->ifTrue(static fn (mixed $v): bool => null !== $v && !\is_int($v))
56+
->thenInvalid('The page_limit must be an integer or null.')
57+
->end()
5458
->end()
5559
->booleanNode('convert_exception')
5660
->defaultFalse()

0 commit comments

Comments
 (0)