From ee2cc86306d88dc7ca0255fe10375c2087268cd8 Mon Sep 17 00:00:00 2001 From: Pavlo Pavliukovych Date: Mon, 10 Jul 2023 18:46:54 +0200 Subject: [PATCH 1/4] Fix Deprecatin warning for PHP 8.2 --- src/Validator/ValidationNode.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Validator/ValidationNode.php b/src/Validator/ValidationNode.php index 4925b65de..c10a9d755 100644 --- a/src/Validator/ValidationNode.php +++ b/src/Validator/ValidationNode.php @@ -22,6 +22,7 @@ * It also contains variables of the resolver context, in which this class was * instantiated. */ +#[\AllowDynamicProperties] class ValidationNode { private const KNOWN_VAR_NAMES = ['value', 'args', 'context', 'info']; From ebd49b9dbb645493ad3b239e09c4d64f8a601873 Mon Sep 17 00:00:00 2001 From: Pavlo Pavliukovych Date: Mon, 10 Jul 2023 20:33:52 +0200 Subject: [PATCH 2/4] Codestyle fixes --- src/Validator/ValidationNode.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Validator/ValidationNode.php b/src/Validator/ValidationNode.php index c10a9d755..a52ef30d4 100644 --- a/src/Validator/ValidationNode.php +++ b/src/Validator/ValidationNode.php @@ -4,6 +4,7 @@ namespace Overblog\GraphQLBundle\Validator; +use AllowDynamicProperties; use GraphQL\Type\Definition\InputObjectType; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; @@ -22,7 +23,8 @@ * It also contains variables of the resolver context, in which this class was * instantiated. */ -#[\AllowDynamicProperties] +/* @phpstan-ignore-next-line */ +#[AllowDynamicProperties] class ValidationNode { private const KNOWN_VAR_NAMES = ['value', 'args', 'context', 'info']; From cbe7894c2b5fbf6bc8d3e979cfc6ae2505917ef6 Mon Sep 17 00:00:00 2001 From: Pavlo Pavliukovych Date: Mon, 17 Jul 2023 12:12:43 +0200 Subject: [PATCH 3/4] Fix Profiler --- src/Controller/ProfilerController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Controller/ProfilerController.php b/src/Controller/ProfilerController.php index d0d7ec475..d9b52441d 100644 --- a/src/Controller/ProfilerController.php +++ b/src/Controller/ProfilerController.php @@ -9,6 +9,7 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\Routing\RouterInterface; use Twig\Environment; @@ -52,6 +53,10 @@ public function __invoke(Request $request, string $token): Response $this->profiler->disable(); $profile = $this->profiler->loadProfile($token); + // Type hint as int for the $limit argument of the find method was updated in Symfony 5.4.22 and 6.2.8 + $limit = (Kernel::VERSION_ID >= 60208 || (Kernel::MAJOR_VERSION === 5 && Kernel::VERSION_ID >= 50422)) + ? 100 + : '100'; $tokens = array_map(function ($tokenData) { $profile = $this->profiler->loadProfile($tokenData['token']); @@ -61,7 +66,7 @@ public function __invoke(Request $request, string $token): Response $tokenData['graphql'] = $profile->getCollector('graphql'); return $tokenData; - }, $this->profiler->find(null, $this->queryMatch ?: $this->endpointUrl, '100', 'POST', null, null, null)); // @phpstan-ignore-line + }, $this->profiler->find(null, $this->queryMatch ?: $this->endpointUrl, $limit, 'POST', null, null, null)); // @phpstan-ignore-line $schemas = []; foreach ($this->requestExecutor->getSchemasNames() as $schemaName) { From 22eb89a4cc5802940a48c41a80c8ced1eca81598 Mon Sep 17 00:00:00 2001 From: Pavlo Pavliukovych Date: Mon, 17 Jul 2023 13:46:34 +0200 Subject: [PATCH 4/4] Codestyle fixes --- src/Controller/ProfilerController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controller/ProfilerController.php b/src/Controller/ProfilerController.php index d9b52441d..e59ccf893 100644 --- a/src/Controller/ProfilerController.php +++ b/src/Controller/ProfilerController.php @@ -54,6 +54,7 @@ public function __invoke(Request $request, string $token): Response $profile = $this->profiler->loadProfile($token); // Type hint as int for the $limit argument of the find method was updated in Symfony 5.4.22 and 6.2.8 + // @phpstan-ignore-next-line $limit = (Kernel::VERSION_ID >= 60208 || (Kernel::MAJOR_VERSION === 5 && Kernel::VERSION_ID >= 50422)) ? 100 : '100';