File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 25
25
uses : actions/checkout@v4
26
26
- name : Run PHP-CS-Fixer
27
27
uses : docker://oskarstark/php-cs-fixer-ga
28
+ with :
29
+ args : --diff --dry-run
28
30
29
31
twig-cs-fixer :
30
32
runs-on : ubuntu-24.04
Original file line number Diff line number Diff line change 28
28
"twig/twig" : " ^3.0"
29
29
},
30
30
"require-dev" : {
31
- "phpstan/phpstan" : " ^1.11 " ,
32
- "phpunit/phpunit" : " ^10.5 || ^11.3 " ,
31
+ "phpstan/phpstan" : " ^1.12 " ,
32
+ "phpunit/phpunit" : " ^10.5 || ^11.5 || ^12.0 " ,
33
33
"symfony/expression-language" : " ^6.4 || ^7.0" ,
34
34
"symfony/templating" : " ^6.4 || ^7.0"
35
35
},
Original file line number Diff line number Diff line change 3
3
namespace Knp \Bundle \PaginatorBundle \Twig \Extension ;
4
4
5
5
use Twig \Extension \AbstractExtension ;
6
- use Twig \TwigFilter ;
7
6
use Twig \TwigFunction ;
8
7
9
8
final class PaginationExtension extends AbstractExtension
Original file line number Diff line number Diff line change @@ -109,26 +109,26 @@ public function filter(
109
109
}
110
110
111
111
/**
112
- * @param array<string, mixed> $query
113
- * @param int $page
114
- * @param array<string, mixed> $options
112
+ * @param array<string, mixed> $query
113
+ * @param array<string, mixed> $options
114
+ *
115
115
* @return array<string, mixed>
116
116
*/
117
117
public function getQueryParams (array $ query , int $ page , array $ options = []): array
118
118
{
119
119
$ pageName = $ this ->pageName ;
120
- if (isset ($ options ['pageParameterName ' ]) && is_string ($ options ['pageParameterName ' ])) {
120
+ if (isset ($ options ['pageParameterName ' ]) && \ is_string ($ options ['pageParameterName ' ])) {
121
121
$ pageName = $ options ['pageParameterName ' ];
122
122
}
123
123
124
- if ($ page === 1 && $ this ->skipFirstPageLink ) {
124
+ if (1 === $ page && $ this ->skipFirstPageLink ) {
125
125
if (isset ($ query [$ pageName ])) {
126
126
unset($ query [$ pageName ]);
127
127
}
128
128
129
129
return $ query ;
130
130
}
131
131
132
- return array_merge ($ query , [$ pageName => $ page ]);
132
+ return \ array_merge ($ query , [$ pageName => $ page ]);
133
133
}
134
134
}
You can’t perform that action at this time.
0 commit comments