Skip to content

Commit e3b8342

Browse files
committed
Symfony 6.0
1 parent 25c3cb4 commit e3b8342

File tree

10 files changed

+134
-36
lines changed

10 files changed

+134
-36
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
symfony-version:
2323
- '5.3.*'
2424
- '5.4.*'
25+
- '6.0.*'
2526
dependencies:
2627
- 'lowest'
2728
- 'highest'

composer.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
"murtukov/php-code-generator": "^0.1.5",
3131
"phpdocumentor/reflection-docblock": "^5.2",
3232
"psr/log": "^1.0",
33-
"symfony/config": "^5.3.7",
34-
"symfony/dependency-injection": "^5.3.7",
35-
"symfony/event-dispatcher": "^5.3",
36-
"symfony/expression-language": "^5.3",
37-
"symfony/framework-bundle": "^5.3.7",
38-
"symfony/http-foundation": "^5.3.7",
39-
"symfony/http-kernel": "^5.3",
40-
"symfony/options-resolver": "^5.3",
41-
"symfony/property-access": "^5.3",
33+
"symfony/config": "^5.3.7 || ^6.0",
34+
"symfony/dependency-injection": "^5.3.7 || ^6.0",
35+
"symfony/event-dispatcher": "^5.3 || ^6.0",
36+
"symfony/expression-language": "^5.3 || ^6.0",
37+
"symfony/framework-bundle": "^5.3.7 || ^6.0",
38+
"symfony/http-foundation": "^5.3.7 || ^6.0",
39+
"symfony/http-kernel": "^5.3 || ^6.0",
40+
"symfony/options-resolver": "^5.3 || ^6.0",
41+
"symfony/property-access": "^5.3 || ^6.0",
4242
"webonyx/graphql-php": "dev-master"
4343
},
4444
"suggest": {
@@ -57,20 +57,20 @@
5757
"phpstan/phpstan-symfony": "^1.0",
5858
"phpunit/phpunit": "^9.5.10",
5959
"react/promise": "^2.5",
60-
"symfony/asset": "^5.3",
61-
"symfony/browser-kit": "^5.3",
62-
"symfony/css-selector": "^5.3",
63-
"symfony/console": "^5.3",
64-
"symfony/dom-crawler": "^5.3.7",
65-
"symfony/finder": "^5.3.7",
60+
"symfony/asset": "^5.3 || ^6.0",
61+
"symfony/browser-kit": "^5.3 || ^6.0",
62+
"symfony/css-selector": "^5.3 || ^6.0",
63+
"symfony/console": "^5.3 || ^6.0",
64+
"symfony/dom-crawler": "^5.3.7 || ^6.0",
65+
"symfony/finder": "^5.3.7 || ^6.0",
6666
"symfony/monolog-bundle": "^3.7",
6767
"symfony/phpunit-bridge": "^6.0",
68-
"symfony/process": "^5.3.7",
69-
"symfony/routing": "^5.3.7",
70-
"symfony/security-bundle": "^5.3",
71-
"symfony/validator": "^5.3.7",
72-
"symfony/var-dumper": "^5.3.7",
73-
"symfony/yaml": "^5.3",
68+
"symfony/process": "^5.3.7 || ^6.0",
69+
"symfony/routing": "^5.3.7 || ^6.0",
70+
"symfony/security-bundle": "^5.3 || ^6.0",
71+
"symfony/validator": "^5.3.7 || ^6.0",
72+
"symfony/var-dumper": "^5.3.7 || ^6.0",
73+
"symfony/yaml": "^5.3 || ^6.0",
7474
"twig/twig": "^3.0"
7575
},
7676
"conflict": {

phpstan-baseline.neon

Lines changed: 105 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ parameters:
100100
count: 1
101101
path: src/DependencyInjection/Compiler/ConfigParserPass.php
102102

103+
-
104+
message: "#^Property Overblog\\\\GraphQLBundle\\\\DependencyInjection\\\\Compiler\\\\ConfigParserPass\\:\\:\\$preTreatedFiles is never read, only written\\.$#"
105+
count: 1
106+
path: src/DependencyInjection/Compiler/ConfigParserPass.php
107+
108+
-
109+
message: "#^Property Overblog\\\\GraphQLBundle\\\\DependencyInjection\\\\Compiler\\\\ConfigParserPass\\:\\:\\$treatedFiles is never read, only written\\.$#"
110+
count: 1
111+
path: src/DependencyInjection/Compiler/ConfigParserPass.php
112+
103113
-
104114
message: "#^Trying to invoke array\\{'Overblog…'\\|'Overblog…'\\|'Overblog…'\\|'Overblog…', 'parse'\\|'preParse'\\} but it might not be a callable\\.$#"
105115
count: 1
@@ -175,6 +185,11 @@ parameters:
175185
count: 1
176186
path: src/Resolver/TypeResolver.php
177187

188+
-
189+
message: "#^Method Overblog\\\\GraphQLBundle\\\\Validator\\\\Constraints\\\\ExpressionValidator\\:\\:validate\\(\\) has parameter \\$value with no type specified\\.$#"
190+
count: 1
191+
path: src/Validator/Constraints/ExpressionValidator.php
192+
178193
-
179194
message: "#^Array \\(array\\<Symfony\\\\Component\\\\Validator\\\\Mapping\\\\ClassMetadataInterface\\>\\) does not accept Symfony\\\\Component\\\\Validator\\\\Mapping\\\\MetadataInterface\\.$#"
180195
count: 1
@@ -190,16 +205,36 @@ parameters:
190205
count: 1
191206
path: src/Validator/InputValidator.php
192207

208+
-
209+
message: "#^Method Overblog\\\\GraphQLBundle\\\\Validator\\\\Mapping\\\\MetadataFactory\\:\\:getMetadataFor\\(\\) has parameter \\$object with no type specified\\.$#"
210+
count: 1
211+
path: src/Validator/Mapping/MetadataFactory.php
212+
213+
-
214+
message: "#^Method Overblog\\\\GraphQLBundle\\\\Validator\\\\Mapping\\\\MetadataFactory\\:\\:hasMetadataFor\\(\\) has parameter \\$object with no type specified\\.$#"
215+
count: 1
216+
path: src/Validator/Mapping/MetadataFactory.php
217+
193218
-
194219
message: "#^Array \\(array\\<Symfony\\\\Component\\\\Validator\\\\Mapping\\\\PropertyMetadata\\>\\) does not accept Overblog\\\\GraphQLBundle\\\\Validator\\\\Mapping\\\\PropertyMetadata\\.$#"
195220
count: 1
196221
path: src/Validator/Mapping/ObjectMetadata.php
197222

223+
-
224+
message: "#^PHPDoc tag @return with type Overblog\\\\GraphQLBundle\\\\Validator\\\\Mapping\\\\ObjectMetadata is not subtype of native type static\\(Overblog\\\\GraphQLBundle\\\\Validator\\\\Mapping\\\\ObjectMetadata\\)\\.$#"
225+
count: 1
226+
path: src/Validator/Mapping/ObjectMetadata.php
227+
198228
-
199229
message: "#^Call to an undefined method ReflectionMethod\\|ReflectionProperty\\:\\:getValue\\(\\)\\.$#"
200230
count: 1
201231
path: src/Validator/Mapping/PropertyMetadata.php
202232

233+
-
234+
message: "#^Method Overblog\\\\GraphQLBundle\\\\Validator\\\\Mapping\\\\PropertyMetadata\\:\\:getPropertyValue\\(\\) has parameter \\$object with no type specified\\.$#"
235+
count: 1
236+
path: src/Validator/Mapping/PropertyMetadata.php
237+
203238
-
204239
message: "#^Access to an undefined property GraphQL\\\\Language\\\\AST\\\\Node\\:\\:\\$value\\.$#"
205240
count: 1
@@ -225,6 +260,71 @@ parameters:
225260
count: 1
226261
path: tests/Config/Parser/fixtures/annotations/Type/Animal.php
227262

263+
-
264+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$battles has no type specified\\.$#"
265+
count: 1
266+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
267+
268+
-
269+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$bool has no type specified\\.$#"
270+
count: 1
271+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
272+
273+
-
274+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$boolean has no type specified\\.$#"
275+
count: 1
276+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
277+
278+
-
279+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$color has no type specified\\.$#"
280+
count: 1
281+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
282+
283+
-
284+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$creator has no type specified\\.$#"
285+
count: 1
286+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
287+
288+
-
289+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$crystal has no type specified\\.$#"
290+
count: 1
291+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
292+
293+
-
294+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$currentHolder has no type specified\\.$#"
295+
count: 1
296+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
297+
298+
-
299+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$decimal has no type specified\\.$#"
300+
count: 1
301+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
302+
303+
-
304+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$float has no type specified\\.$#"
305+
count: 1
306+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
307+
308+
-
309+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$holders has no type specified\\.$#"
310+
count: 1
311+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
312+
313+
-
314+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$size has no type specified\\.$#"
315+
count: 1
316+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
317+
318+
-
319+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$string has no type specified\\.$#"
320+
count: 1
321+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
322+
323+
-
324+
message: "#^Property Overblog\\\\GraphQLBundle\\\\Tests\\\\Config\\\\Parser\\\\fixtures\\\\annotations\\\\Type\\\\Lightsaber\\:\\:\\$text has no type specified\\.$#"
325+
count: 1
326+
path: tests/Config/Parser/fixtures/annotations/Type/Lightsaber.php
327+
228328
-
229329
message: "#^Parameter \\#1 \\$exceptionMap of class Overblog\\\\GraphQLBundle\\\\Error\\\\ExceptionConverter constructor expects array\\<string, string\\>, array\\<string, array\\<string\\>\\> given\\.$#"
230330
count: 1
@@ -240,6 +340,11 @@ parameters:
240340
count: 4
241341
path: tests/ExpressionLanguage/ExpressionFunction/Security/GetUserTest.php
242342

343+
-
344+
message: "#^Instantiated class Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\User not found\\.$#"
345+
count: 1
346+
path: tests/ExpressionLanguage/ExpressionFunction/Security/GetUserTest.php
347+
243348
-
244349
message: "#^Call to method disableOriginalConstructor\\(\\) on an unknown class PHPUnit_Framework_MockObject_MockBuilder\\.$#"
245350
count: 1
@@ -300,11 +405,6 @@ parameters:
300405
count: 1
301406
path: tests/Functional/TestCase.php
302407

303-
-
304-
message: "#^Method Overblog\\\\GraphQLBundle\\\\Tests\\\\Functional\\\\TestCase\\:\\:getContainer\\(\\) should return Symfony\\\\Bundle\\\\FrameworkBundle\\\\Test\\\\TestContainer but returns Symfony\\\\Component\\\\DependencyInjection\\\\ContainerInterface\\.$#"
305-
count: 1
306-
path: tests/Functional/TestCase.php
307-
308408
-
309409
message: "#^Missing call to parent\\:\\:tearDown\\(\\) method\\.$#"
310410
count: 1

src/ExpressionLanguage/ExpressionLanguage.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ public function getGlobalNames(): array
3535
/**
3636
* @param string|Expression $expression
3737
* @param array $names
38-
*
39-
* @return string
4038
*/
41-
public function compile($expression, $names = [])
39+
public function compile($expression, $names = []): string
4240
{
4341
return parent::compile($expression, array_merge($names, $this->globalNames));
4442
}

src/Validator/Mapping/ObjectMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(ValidationNode $object)
2121
*
2222
* @return $this|ObjectMetadata
2323
*/
24-
public function addPropertyConstraint($property, Constraint $constraint)
24+
public function addPropertyConstraint($property, Constraint $constraint): static
2525
{
2626
if (!isset($this->properties[$property])) {
2727
$this->properties[$property] = new PropertyMetadata($property);

tests/ExpressionLanguage/ExpressionFunction/GraphQL/ArgumentsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Overblog\GraphQLBundle\Tests\Transformer\InputType1;
1515
use Overblog\GraphQLBundle\Tests\Transformer\InputType2;
1616
use Overblog\GraphQLBundle\Transformer\ArgumentsTransformer;
17+
use Symfony\Component\Validator\ConstraintViolationList;
1718
use Symfony\Component\Validator\Validation;
1819
use Symfony\Component\Validator\Validator\RecursiveValidator;
1920
use function class_exists;
@@ -45,7 +46,7 @@ public function getResolveInfo(array $types): ResolveInfo
4546
private function getTransformer(array $classesMap = null): ArgumentsTransformer
4647
{
4748
$validator = $this->createMock(RecursiveValidator::class);
48-
$validator->method('validate')->willReturn([]);
49+
$validator->method('validate')->willReturn(new ConstraintViolationList());
4950

5051
return new ArgumentsTransformer($validator, $classesMap);
5152
}

tests/ExpressionLanguage/ExpressionFunction/Security/GetUserTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ public function getUserProvider(): array
104104

105105
return [
106106
[$user, $user],
107-
['Anon.', null],
108107
[null, null],
109-
[10, null],
110-
[true, null],
111108
];
112109
}
113110

tests/Functional/App/config/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ security:
2020
password: 123
2121
roles: 'ROLE_ADMIN'
2222
password_hashers:
23-
Symfony\Component\Security\Core\User\User: plaintext
23+
Symfony\Component\Security\Core\User\InMemoryUser: plaintext
2424
firewalls:
2525
graph:
2626
pattern: ^/

tests/Functional/TestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ protected static function assertGraphQL(string $query, array $expectedData = nul
103103

104104
protected static function getContainer(): ContainerInterface
105105
{
106+
/** @phpstan-ignore-next-line */
106107
return static::$kernel->getContainer();
107108
}
108109

tests/Transformer/ArgumentsTransformerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function setUp(): void
3838
private function getTransformer(array $classesMap = null, ConstraintViolationList $validateReturn = null): ArgumentsTransformer
3939
{
4040
$validator = $this->createMock(RecursiveValidator::class);
41-
$validator->method('validate')->willReturn($validateReturn ?: []);
41+
$validator->method('validate')->willReturn($validateReturn ?? new ConstraintViolationList());
4242

4343
return new ArgumentsTransformer($validator, $classesMap);
4444
}

0 commit comments

Comments
 (0)