9
9
use Symfony \Component \DependencyInjection \Exception \ServiceNotFoundException ;
10
10
use Symfony \Component \HttpFoundation \Request ;
11
11
use Symfony \Component \HttpFoundation \Response ;
12
+ use Symfony \Component \HttpKernel \Kernel ;
12
13
use Symfony \Component \HttpKernel \Profiler \Profiler ;
13
14
use Symfony \Component \Routing \RouterInterface ;
14
15
use Twig \Environment ;
@@ -52,6 +53,11 @@ public function __invoke(Request $request, string $token): Response
52
53
$ this ->profiler ->disable ();
53
54
54
55
$ profile = $ this ->profiler ->loadProfile ($ token );
56
+ // Type hint as int for the $limit argument of the find method was updated in Symfony 5.4.22 and 6.2.8
57
+ // @phpstan-ignore-next-line
58
+ $ limit = (Kernel::VERSION_ID >= 60208 || (Kernel::MAJOR_VERSION === 5 && Kernel::VERSION_ID >= 50422 ))
59
+ ? 100
60
+ : '100 ' ;
55
61
56
62
$ tokens = array_map (function ($ tokenData ) {
57
63
$ profile = $ this ->profiler ->loadProfile ($ tokenData ['token ' ]);
@@ -61,7 +67,7 @@ public function __invoke(Request $request, string $token): Response
61
67
$ tokenData ['graphql ' ] = $ profile ->getCollector ('graphql ' );
62
68
63
69
return $ tokenData ;
64
- }, $ this ->profiler ->find (null , $ this ->queryMatch ?: $ this ->endpointUrl , ' 100 ' , 'POST ' , null , null , null )); // @phpstan-ignore-line
70
+ }, $ this ->profiler ->find (null , $ this ->queryMatch ?: $ this ->endpointUrl , $ limit , 'POST ' , null , null , null )); // @phpstan-ignore-line
65
71
66
72
$ schemas = [];
67
73
foreach ($ this ->requestExecutor ->getSchemasNames () as $ schemaName ) {
0 commit comments