Skip to content

Commit

Permalink
fix(jsonapi): fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien COURJEAN committed Apr 16, 2024
1 parent 69739f0 commit bd0d6a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/State/Pagination/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,16 @@ private function getGraphQlEnabled(?Operation $operation): bool
/**
* Extract pagination parameter
* page[page] => $contextFilters['page'] with default configuration page_parameter_name: page
* page[number] => $contextFilters['_page'][number] with configuration page_parameter_name: page[number]
* page[number] => $contextFilters['_page'][number] with configuration page_parameter_name: page[number].
*/
private function extractParameter(array $contextFilters, string $parameterName)
{
preg_match_all("/[\w-]+/", $parameterName, $matches);
foreach ($matches[0] as $i => $key) {
if ($i === 0 && $key === 'page' && count($matches[0]) > 1) {
if (0 === $i && 'page' === $key && \count($matches[0]) > 1) {
$key = '_page';
}
if (\is_array($contextFilters) === false) {
if (false === \is_array($contextFilters)) {
return $contextFilters;
}
if (!\array_key_exists($key, $contextFilters)) {
Expand Down

0 comments on commit bd0d6a4

Please sign in to comment.