Skip to content

Commit 2263e37

Browse files
committed
Add a constant for default max per page
1 parent 277ae28 commit 2263e37

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Component/src/Grid/State/RequestGridProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
final class RequestGridProvider implements ProviderInterface
2727
{
28+
private const DEFAULT_MAX_PER_PAGE = 10;
29+
2830
public function __construct(
2931
private ?GridViewFactoryInterface $gridViewFactory = null,
3032
private ?GridProviderInterface $gridProvider = null,
@@ -80,7 +82,7 @@ private function resolveMaxPerPage(?int $requestLimit, array $gridLimits = []):
8082
if (null === $requestLimit) {
8183
$firstGridLimit = reset($gridLimits);
8284

83-
return false === $firstGridLimit ? 10 : $firstGridLimit;
85+
return false === $firstGridLimit ? self::DEFAULT_MAX_PER_PAGE : $firstGridLimit;
8486
}
8587

8688
if (!empty($gridLimits)) {

0 commit comments

Comments
 (0)