Skip to content

Commit 56e02f6

Browse files
committed
page_limit config must accept null
1 parent d6474ee commit 56e02f6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,16 @@ 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()
58+
->beforeNormalization()
59+
->ifNull()
60+
->then(static fn (mixed $v): int => 5)
61+
->end()
5462
->end()
5563
->booleanNode('convert_exception')
5664
->defaultFalse()

0 commit comments

Comments
 (0)