Skip to content

Commit e1facd3

Browse files
authored
Merge pull request #1126 from aviator-ua/fix-deprecation-warning
Fix Deprecation warning for PHP 8.2
2 parents d0e1ce2 + 22eb89a commit e1facd3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Controller/ProfilerController.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
1010
use Symfony\Component\HttpFoundation\Request;
1111
use Symfony\Component\HttpFoundation\Response;
12+
use Symfony\Component\HttpKernel\Kernel;
1213
use Symfony\Component\HttpKernel\Profiler\Profiler;
1314
use Symfony\Component\Routing\RouterInterface;
1415
use Twig\Environment;
@@ -52,6 +53,11 @@ public function __invoke(Request $request, string $token): Response
5253
$this->profiler->disable();
5354

5455
$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';
5561

5662
$tokens = array_map(function ($tokenData) {
5763
$profile = $this->profiler->loadProfile($tokenData['token']);
@@ -61,7 +67,7 @@ public function __invoke(Request $request, string $token): Response
6167
$tokenData['graphql'] = $profile->getCollector('graphql');
6268

6369
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
6571

6672
$schemas = [];
6773
foreach ($this->requestExecutor->getSchemasNames() as $schemaName) {

src/Validator/ValidationNode.php

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Overblog\GraphQLBundle\Validator;
66

7+
use AllowDynamicProperties;
78
use GraphQL\Type\Definition\InputObjectType;
89
use GraphQL\Type\Definition\ObjectType;
910
use GraphQL\Type\Definition\ResolveInfo;
@@ -22,6 +23,8 @@
2223
* It also contains variables of the resolver context, in which this class was
2324
* instantiated.
2425
*/
26+
/* @phpstan-ignore-next-line */
27+
#[AllowDynamicProperties]
2528
class ValidationNode
2629
{
2730
private const KNOWN_VAR_NAMES = ['value', 'args', 'context', 'info'];

0 commit comments

Comments
 (0)