Skip to content

Commit 24e126b

Browse files
committed
feat(graphql): update symfony dependencies to 4.4.*|^5.0
1 parent 0970d2f commit 24e126b

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
"php": "7.4.*",
2020
"ext-json": "*",
2121
"doctrine/annotations": "^1.10.0",
22-
"symfony/config": "4.4.*",
23-
"symfony/dependency-injection": "4.4.*",
24-
"symfony/event-dispatcher": "4.4.*",
25-
"symfony/http-foundation": "4.4.*",
26-
"symfony/http-kernel": "4.4.*",
22+
"symfony/config": "4.4.*|^5.0",
23+
"symfony/dependency-injection": "4.4.*|^5.0",
24+
"symfony/event-dispatcher": "4.4.*|^5.0",
25+
"symfony/http-foundation": "4.4.*|^5.0",
26+
"symfony/http-kernel": "4.4.*|^5.0",
2727
"symfony/options-resolver": "^5.0"
2828
},
2929
"require-dev": {

src/EventListener/ReadGraphQLRateLmitAnnotationListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public static function getSubscribedEvents(): array
106106
}
107107

108108
/**
109-
* @param Source|string $query
109+
* @param string|int|float|bool|null $query
110110
*/
111111
public function extractQueryName($query): string
112112
{
113+
/** @var Source $query */
113114
$parsedQuery = Parser::parse($query);
114115
/** @var OperationDefinitionNode $item */
115116
foreach ($parsedQuery->definitions->getIterator() as $item) {

tests/EventListener/ReadGraphQLRateLmitAnnotationListenerTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use PHPUnit\Framework\MockObject\MockObject;
1212
use PHPUnit\Framework\TestCase;
1313
use Symfony\Component\DependencyInjection\ContainerInterface;
14+
use Symfony\Component\HttpFoundation\InputBag;
1415
use Symfony\Component\HttpFoundation\ParameterBag;
1516
use Symfony\Component\HttpFoundation\Request;
1617
use Symfony\Component\HttpKernel\Event\ControllerEvent;
@@ -64,7 +65,7 @@ public function testItSetsGraphQLRateLimitIfAnnotationProvidedWithDefaultValue()
6465
$this->createGraphQLReadRateLimitAnnotationListener();
6566
$request = $this->createMock(Request::class);
6667
$request->attributes = new ParameterBag();
67-
$request->request = new ParameterBag();
68+
$request->request = new InputBag();
6869
$event = $this->createEventWithGraphQLAnnotation($request, false);
6970

7071
$this->container->expects($this->never())
@@ -94,7 +95,7 @@ public function testItSetsGraphQLRateLimitIfAnnotationProvidedWithCustomValue():
9495
$this->createGraphQLReadRateLimitAnnotationListener();
9596
$request = $this->createMock(Request::class);
9697
$request->attributes = new ParameterBag();
97-
$request->request = new ParameterBag();
98+
$request->request = new InputBag();
9899
$event = $this->createEventWithGraphQLAnnotation($request, true);
99100

100101
$this->container->expects($this->never())
@@ -124,7 +125,7 @@ public function testIttDoesNotSetRateLimitIfGraphQLAnnotationAndEndpointNotConfi
124125
$this->createGraphQLReadRateLimitAnnotationListener();
125126
$request = $this->createMock(Request::class);
126127
$request->attributes = new ParameterBag();
127-
$request->request = new ParameterBag();
128+
$request->request = new InputBag();
128129
$event = $this->createEventWithGraphQLAnnotation($request, false);
129130

130131
$this->container->expects($this->never())
@@ -147,7 +148,7 @@ public function testItSetsGraphQLRateLimitIfPackageNotInstalled(): void
147148
$this->createGraphQLReadRateLimitAnnotationListener();
148149
$request = $this->createMock(Request::class);
149150
$request->attributes = new ParameterBag();
150-
$request->request = new ParameterBag();
151+
$request->request = new InputBag();
151152
$event = $this->createEventWithGraphQLAnnotation($request, false);
152153

153154
$this->annotationReader->expects($this->once())->method('getMethodAnnotation')->willReturn(new GraphQLRateLimitAnnotation(['endpoints' => [['endpoint' => 'GetObject']]]));

0 commit comments

Comments
 (0)