diff --git a/src/SchemaFactory.php b/src/SchemaFactory.php index 11dcdf71f7..2e7ac5e746 100644 --- a/src/SchemaFactory.php +++ b/src/SchemaFactory.php @@ -381,14 +381,9 @@ public function createSchema(): Schema $errorRootTypeMapper = new FinalRootTypeMapper($recursiveTypeMapper); $rootTypeMapper = new BaseTypeMapper($errorRootTypeMapper, $recursiveTypeMapper, $topRootTypeMapper); - - if (interface_exists(UnitEnum::class)) { - $rootTypeMapper = new EnumTypeMapper($rootTypeMapper, $annotationReader, $symfonyCache, $nsList); - } - - if (class_exists(Enum::class)) { - $rootTypeMapper = new MyCLabsEnumTypeMapper($rootTypeMapper, $annotationReader, $symfonyCache, $nsList); - } + $rootTypeMapper = new EnumTypeMapper($rootTypeMapper, $annotationReader, $symfonyCache, $nsList); + // Annotation support - deprecated + $rootTypeMapper = new MyCLabsEnumTypeMapper($rootTypeMapper, $annotationReader, $symfonyCache, $nsList); if (! empty($this->rootTypeMapperFactories)) { $rootSchemaFactoryContext = new RootTypeMapperFactoryContext( diff --git a/tests/AbstractQueryProviderTest.php b/tests/AbstractQueryProviderTest.php index 2f59ff768b..16b6de62d5 100644 --- a/tests/AbstractQueryProviderTest.php +++ b/tests/AbstractQueryProviderTest.php @@ -356,6 +356,7 @@ protected function buildRootTypeMapper(): RootTypeMapperInterface $topRootTypeMapper ); + // Annotation support - deprecated $rootTypeMapper = new MyCLabsEnumTypeMapper( $rootTypeMapper, $this->getAnnotationReader(), @@ -363,14 +364,12 @@ protected function buildRootTypeMapper(): RootTypeMapperInterface [] ); - if (interface_exists(UnitEnum::class)) { - $rootTypeMapper = new EnumTypeMapper( - $rootTypeMapper, - $this->getAnnotationReader(), - $arrayAdapter, - [] - ); - } + $rootTypeMapper = new EnumTypeMapper( + $rootTypeMapper, + $this->getAnnotationReader(), + $arrayAdapter, + [] + ); $rootTypeMapper = new CompoundTypeMapper( $rootTypeMapper, diff --git a/tests/AnnotationReaderTest.php b/tests/AnnotationReaderTest.php index bb57bd6714..a476222c27 100644 --- a/tests/AnnotationReaderTest.php +++ b/tests/AnnotationReaderTest.php @@ -154,9 +154,6 @@ public function testEmptyGetParameterAnnotations(): void $this->assertEmpty($annotationReader->getParameterAnnotationsPerParameter([])); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8AttributeClassAnnotation(): void { $annotationReader = new AnnotationReader(new DoctrineAnnotationReader()); @@ -169,9 +166,6 @@ public function testPhp8AttributeClassAnnotation(): void //$this->assertSame($type, $type2, 'Assert some cache is available'); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8AttributeClassAnnotations(): void { $annotationReader = new AnnotationReader(new DoctrineAnnotationReader()); @@ -181,9 +175,6 @@ public function testPhp8AttributeClassAnnotations(): void $this->assertCount(3, $types); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8AttributeMethodAnnotation(): void { $annotationReader = new AnnotationReader(new DoctrineAnnotationReader()); @@ -192,9 +183,6 @@ public function testPhp8AttributeMethodAnnotation(): void $this->assertInstanceOf(Field::class, $type); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8AttributeMethodAnnotations(): void { $annotationReader = new AnnotationReader(new DoctrineAnnotationReader()); @@ -209,9 +197,6 @@ public function testPhp8AttributeMethodAnnotations(): void $this->assertTrue($securitys[1]->isFailWithSet()); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8AttributeParameterAnnotations(): void { $annotationReader = new AnnotationReader(new DoctrineAnnotationReader()); diff --git a/tests/Annotations/DecorateTest.php b/tests/Annotations/DecorateTest.php index 16f82d5e53..083fff18d1 100644 --- a/tests/Annotations/DecorateTest.php +++ b/tests/Annotations/DecorateTest.php @@ -16,9 +16,6 @@ public function testException(): void new Decorate([]); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8Annotation(): void { $method = new ReflectionMethod(__CLASS__, 'method1'); diff --git a/tests/Annotations/FailWithTest.php b/tests/Annotations/FailWithTest.php index 720d24ae3e..79842c7029 100644 --- a/tests/Annotations/FailWithTest.php +++ b/tests/Annotations/FailWithTest.php @@ -16,9 +16,6 @@ public function testException(): void new FailWith([]); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8Annotation(): void { $method = new ReflectionMethod(__CLASS__, 'method1'); diff --git a/tests/Annotations/RightTest.php b/tests/Annotations/RightTest.php index 224aa65a31..4ca7fa86ed 100644 --- a/tests/Annotations/RightTest.php +++ b/tests/Annotations/RightTest.php @@ -16,9 +16,6 @@ public function testException(): void new Right([]); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8Annotation(): void { $method = new ReflectionMethod(__CLASS__, 'method1'); diff --git a/tests/Annotations/UseInputTypeTest.php b/tests/Annotations/UseInputTypeTest.php index f568640e05..47cb85b329 100644 --- a/tests/Annotations/UseInputTypeTest.php +++ b/tests/Annotations/UseInputTypeTest.php @@ -23,9 +23,6 @@ public function testException2(): void (new UseInputType(['inputType' => 'foo']))->getTarget(); } - /** - * @requires PHP >= 8.0 - */ public function testPhp8Annotation(): void { $attribute = new UseInputType('foo'); diff --git a/tests/FieldsBuilderTest.php b/tests/FieldsBuilderTest.php index 137a02e72e..9f25172526 100644 --- a/tests/FieldsBuilderTest.php +++ b/tests/FieldsBuilderTest.php @@ -70,8 +70,8 @@ use TheCodingMachine\GraphQLite\Security\VoidAuthenticationService; use TheCodingMachine\GraphQLite\Security\VoidAuthorizationService; use TheCodingMachine\GraphQLite\Annotations\Query; -use TheCodingMachine\GraphQLite\Fixtures80\PropertyPromotionInputType; -use TheCodingMachine\GraphQLite\Fixtures80\PropertyPromotionInputTypeWithoutGenericDoc; +use TheCodingMachine\GraphQLite\Fixtures\PropertyPromotionInputType; +use TheCodingMachine\GraphQLite\Fixtures\PropertyPromotionInputTypeWithoutGenericDoc; use TheCodingMachine\GraphQLite\Types\DateTimeType; use TheCodingMachine\GraphQLite\Types\VoidType; @@ -203,8 +203,6 @@ public function test($typeHintInDocBlock) /** * Tests that the fields builder will fail when a parameter is missing it's generic docblock * definition, when required - an array, for instance, or could be a collection (List types) - * - * @requires PHP >= 8.0 */ public function testTypeMissingForPropertyPromotionWithoutGenericDoc(): void { @@ -221,8 +219,6 @@ public function testTypeMissingForPropertyPromotionWithoutGenericDoc(): void /** * Tests that the fields builder will properly build an input type using property promotion * with the generic docblock defined on the constructor and not the property directly. - * - * @requires PHP >= 8.0 */ public function testTypeInDocBlockWithPropertyPromotion(): void { diff --git a/tests/Fixtures81/Integration/Controllers/ButtonController.php b/tests/Fixtures/Integration/Controllers/ButtonController.php similarity index 66% rename from tests/Fixtures81/Integration/Controllers/ButtonController.php rename to tests/Fixtures/Integration/Controllers/ButtonController.php index 6b0eca2e7d..6d99488d05 100644 --- a/tests/Fixtures81/Integration/Controllers/ButtonController.php +++ b/tests/Fixtures/Integration/Controllers/ButtonController.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace TheCodingMachine\GraphQLite\Fixtures81\Integration\Controllers; +namespace TheCodingMachine\GraphQLite\Fixtures\Integration\Controllers; use TheCodingMachine\GraphQLite\Annotations\Mutation; use TheCodingMachine\GraphQLite\Annotations\Query; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Button; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Color; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Position; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Size; +use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Button; +use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Color; +use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Position; +use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Size; use TheCodingMachine\GraphQLite\Types\ID; final class ButtonController diff --git a/tests/Fixtures81/Integration/Models/Button.php b/tests/Fixtures/Integration/Models/Button.php similarity index 92% rename from tests/Fixtures81/Integration/Models/Button.php rename to tests/Fixtures/Integration/Models/Button.php index 9202216090..4685ac00a3 100644 --- a/tests/Fixtures81/Integration/Models/Button.php +++ b/tests/Fixtures/Integration/Models/Button.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TheCodingMachine\GraphQLite\Fixtures81\Integration\Models; +namespace TheCodingMachine\GraphQLite\Fixtures\Integration\Models; use TheCodingMachine\GraphQLite\Annotations\Field; use TheCodingMachine\GraphQLite\Annotations\Type; diff --git a/tests/Fixtures81/Integration/Models/Color.php b/tests/Fixtures/Integration/Models/Color.php similarity index 75% rename from tests/Fixtures81/Integration/Models/Color.php rename to tests/Fixtures/Integration/Models/Color.php index 1d6c4d4a1a..dabc27a518 100644 --- a/tests/Fixtures81/Integration/Models/Color.php +++ b/tests/Fixtures/Integration/Models/Color.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TheCodingMachine\GraphQLite\Fixtures81\Integration\Models; +namespace TheCodingMachine\GraphQLite\Fixtures\Integration\Models; use TheCodingMachine\GraphQLite\Annotations\Type; diff --git a/tests/Fixtures81/Integration/Models/Position.php b/tests/Fixtures/Integration/Models/Position.php similarity index 68% rename from tests/Fixtures81/Integration/Models/Position.php rename to tests/Fixtures/Integration/Models/Position.php index efd8cdf0db..a24e5645ac 100644 --- a/tests/Fixtures81/Integration/Models/Position.php +++ b/tests/Fixtures/Integration/Models/Position.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TheCodingMachine\GraphQLite\Fixtures81\Integration\Models; +namespace TheCodingMachine\GraphQLite\Fixtures\Integration\Models; use TheCodingMachine\GraphQLite\Annotations\Type; diff --git a/tests/Fixtures81/Integration/Models/Size.php b/tests/Fixtures/Integration/Models/Size.php similarity index 67% rename from tests/Fixtures81/Integration/Models/Size.php rename to tests/Fixtures/Integration/Models/Size.php index 0ed23d2c81..abe9431be0 100644 --- a/tests/Fixtures81/Integration/Models/Size.php +++ b/tests/Fixtures/Integration/Models/Size.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TheCodingMachine\GraphQLite\Fixtures81\Integration\Models; +namespace TheCodingMachine\GraphQLite\Fixtures\Integration\Models; use TheCodingMachine\GraphQLite\Annotations\Type; diff --git a/tests/Fixtures80/PropertyPromotionInputType.php b/tests/Fixtures/PropertyPromotionInputType.php similarity index 86% rename from tests/Fixtures80/PropertyPromotionInputType.php rename to tests/Fixtures/PropertyPromotionInputType.php index d9850f52a1..f3408b5642 100644 --- a/tests/Fixtures80/PropertyPromotionInputType.php +++ b/tests/Fixtures/PropertyPromotionInputType.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TheCodingMachine\GraphQLite\Fixtures80; +namespace TheCodingMachine\GraphQLite\Fixtures; use TheCodingMachine\GraphQLite\Annotations as GraphQLite; diff --git a/tests/Fixtures80/PropertyPromotionInputTypeWithoutGenericDoc.php b/tests/Fixtures/PropertyPromotionInputTypeWithoutGenericDoc.php similarity index 88% rename from tests/Fixtures80/PropertyPromotionInputTypeWithoutGenericDoc.php rename to tests/Fixtures/PropertyPromotionInputTypeWithoutGenericDoc.php index 9b1391f7b8..2309bda29a 100644 --- a/tests/Fixtures80/PropertyPromotionInputTypeWithoutGenericDoc.php +++ b/tests/Fixtures/PropertyPromotionInputTypeWithoutGenericDoc.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TheCodingMachine\GraphQLite\Fixtures80; +namespace TheCodingMachine\GraphQLite\Fixtures; use TheCodingMachine\GraphQLite\Annotations as GraphQLite; diff --git a/tests/Fixtures80/UnionOutputType.php b/tests/Fixtures/UnionOutputType.php similarity index 88% rename from tests/Fixtures80/UnionOutputType.php rename to tests/Fixtures/UnionOutputType.php index 61ec983abb..df50940b5e 100644 --- a/tests/Fixtures80/UnionOutputType.php +++ b/tests/Fixtures/UnionOutputType.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TheCodingMachine\GraphQLite\Fixtures80; +namespace TheCodingMachine\GraphQLite\Fixtures; use TheCodingMachine\GraphQLite\Fixtures\TestObject; use TheCodingMachine\GraphQLite\Fixtures\TestObject2; diff --git a/tests/Integration/EndToEndTest.php b/tests/Integration/EndToEndTest.php index 2e2e4ed847..daa08ceffe 100644 --- a/tests/Integration/EndToEndTest.php +++ b/tests/Integration/EndToEndTest.php @@ -24,9 +24,9 @@ use TheCodingMachine\GraphQLite\FieldsBuilder; use TheCodingMachine\GraphQLite\Fixtures\Inputs\ValidationException; use TheCodingMachine\GraphQLite\Fixtures\Inputs\Validator; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Color; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Position; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Size; +use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Color; +use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Position; +use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Size; use TheCodingMachine\GraphQLite\GlobControllerQueryProvider; use TheCodingMachine\GraphQLite\GraphQLRuntimeException; use TheCodingMachine\GraphQLite\InputTypeGenerator; diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php index e9d843347a..7d1a18ec99 100644 --- a/tests/Integration/IntegrationTestCase.php +++ b/tests/Integration/IntegrationTestCase.php @@ -5,7 +5,6 @@ use Doctrine\Common\Annotations\AnnotationReader as DoctrineAnnotationReader; use GraphQL\Error\DebugFlag; use GraphQL\Executor\ExecutionResult; -use GraphQL\GraphQL; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use stdClass; @@ -18,19 +17,11 @@ use TheCodingMachine\GraphQLite\Containers\BasicAutoWiringContainer; use TheCodingMachine\GraphQLite\Containers\EmptyContainer; use TheCodingMachine\GraphQLite\Containers\LazyContainer; -use TheCodingMachine\GraphQLite\Context\Context; use TheCodingMachine\GraphQLite\FieldsBuilder; -use TheCodingMachine\GraphQLite\Fixtures\Inputs\ValidationException; -use TheCodingMachine\GraphQLite\Fixtures\Inputs\Validator; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Color; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Position; -use TheCodingMachine\GraphQLite\Fixtures81\Integration\Models\Size; use TheCodingMachine\GraphQLite\GlobControllerQueryProvider; -use TheCodingMachine\GraphQLite\GraphQLRuntimeException; use TheCodingMachine\GraphQLite\InputTypeGenerator; use TheCodingMachine\GraphQLite\InputTypeUtils; use TheCodingMachine\GraphQLite\Loggers\ExceptionLogger; -use TheCodingMachine\GraphQLite\Mappers\CannotMapTypeException; use TheCodingMachine\GraphQLite\Mappers\CompositeTypeMapper; use TheCodingMachine\GraphQLite\Mappers\GlobTypeMapper; use TheCodingMachine\GraphQLite\Mappers\Parameters\ContainerParameterHandler; @@ -60,7 +51,6 @@ use TheCodingMachine\GraphQLite\Middlewares\FieldMiddlewarePipe; use TheCodingMachine\GraphQLite\Middlewares\InputFieldMiddlewareInterface; use TheCodingMachine\GraphQLite\Middlewares\InputFieldMiddlewarePipe; -use TheCodingMachine\GraphQLite\Middlewares\MissingAuthorizationException; use TheCodingMachine\GraphQLite\Middlewares\SecurityFieldMiddleware; use TheCodingMachine\GraphQLite\Middlewares\SecurityInputFieldMiddleware; use TheCodingMachine\GraphQLite\NamingStrategy; @@ -69,18 +59,15 @@ use TheCodingMachine\GraphQLite\QueryProviderInterface; use TheCodingMachine\GraphQLite\Reflection\CachedDocBlockFactory; use TheCodingMachine\GraphQLite\Schema; -use TheCodingMachine\GraphQLite\SchemaFactory; use TheCodingMachine\GraphQLite\Security\AuthenticationServiceInterface; use TheCodingMachine\GraphQLite\Security\AuthorizationServiceInterface; use TheCodingMachine\GraphQLite\Security\SecurityExpressionLanguageProvider; use TheCodingMachine\GraphQLite\Security\VoidAuthenticationService; use TheCodingMachine\GraphQLite\Security\VoidAuthorizationService; use TheCodingMachine\GraphQLite\TypeGenerator; -use TheCodingMachine\GraphQLite\TypeMismatchRuntimeException; use TheCodingMachine\GraphQLite\TypeRegistry; use TheCodingMachine\GraphQLite\Types\ArgumentResolver; use TheCodingMachine\GraphQLite\Types\TypeResolver; -use TheCodingMachine\GraphQLite\Utils\AccessPropertyException; use TheCodingMachine\GraphQLite\Utils\Namespaces\NamespaceFactory; use UnitEnum; @@ -109,18 +96,17 @@ public function createContainer(array $overloadedServices = []): ContainerInterf new Psr16Cache(new ArrayAdapter()), ); - if (interface_exists(UnitEnum::class)) { - $queryProvider = new AggregateQueryProvider([ - $queryProvider, - new GlobControllerQueryProvider( - 'TheCodingMachine\\GraphQLite\\Fixtures81\\Integration\\Controllers', - $container->get(FieldsBuilder::class), - $container->get(BasicAutoWiringContainer::class), - $container->get(AnnotationReader::class), - new Psr16Cache(new ArrayAdapter()), - ), - ]); - } + $queryProvider = new AggregateQueryProvider([ + $queryProvider, + new GlobControllerQueryProvider( + 'TheCodingMachine\\GraphQLite\\Fixtures\\Integration\\Controllers', + $container->get(FieldsBuilder::class), + $container->get(BasicAutoWiringContainer::class), + $container->get(AnnotationReader::class), + new Psr16Cache(new ArrayAdapter()), + ), + ]); + return $queryProvider; }, FieldsBuilder::class => static function (ContainerInterface $container) { @@ -258,7 +244,7 @@ public function createContainer(array $overloadedServices = []): ContainerInterf new ArrayAdapter(), [ $container->get(NamespaceFactory::class) - ->createNamespace('TheCodingMachine\\GraphQLite\\Fixtures81\\Integration\\Models'), + ->createNamespace('TheCodingMachine\\GraphQLite\\Fixtures\\Integration\\Models'), ], ); }, @@ -313,9 +299,7 @@ public function createContainer(array $overloadedServices = []): ContainerInterf $errorRootTypeMapper = new FinalRootTypeMapper($container->get(RecursiveTypeMapperInterface::class)); $rootTypeMapper = new BaseTypeMapper($errorRootTypeMapper, $container->get(RecursiveTypeMapperInterface::class), $container->get(RootTypeMapperInterface::class)); $rootTypeMapper = new MyCLabsEnumTypeMapper($rootTypeMapper, $container->get(AnnotationReader::class), new ArrayAdapter(), [ $container->get(NamespaceFactory::class)->createNamespace('TheCodingMachine\\GraphQLite\\Fixtures\\Integration\\Models') ]); - if (interface_exists(UnitEnum::class)) { - $rootTypeMapper = new EnumTypeMapper($rootTypeMapper, $container->get(AnnotationReader::class), new ArrayAdapter(), [ $container->get(NamespaceFactory::class)->createNamespace('TheCodingMachine\\GraphQLite\\Fixtures81\\Integration\\Models') ]); - } + $rootTypeMapper = new EnumTypeMapper($rootTypeMapper, $container->get(AnnotationReader::class), new ArrayAdapter(), [ $container->get(NamespaceFactory::class)->createNamespace('TheCodingMachine\\GraphQLite\\Fixtures\\Integration\\Models') ]); $rootTypeMapper = new CompoundTypeMapper($rootTypeMapper, $container->get(RootTypeMapperInterface::class), $container->get(NamingStrategyInterface::class), $container->get(TypeRegistry::class), $container->get(RecursiveTypeMapperInterface::class)); $rootTypeMapper = new IteratorTypeMapper($rootTypeMapper, $container->get(RootTypeMapperInterface::class)); return $rootTypeMapper; @@ -343,42 +327,14 @@ public function createContainer(array $overloadedServices = []): ContainerInterf }, ]; - if (interface_exists(UnitEnum::class)) { - // Register another instance of GlobTypeMapper to process our PHP 8.1 enums and/or other - // 8.1 supported features. - $services[GlobTypeMapper::class . '3'] = static function (ContainerInterface $container) { - $arrayAdapter = new ArrayAdapter(); - $arrayAdapter->setLogger(new ExceptionLogger()); - return new GlobTypeMapper( - $container->get(NamespaceFactory::class)->createNamespace('TheCodingMachine\\GraphQLite\\Fixtures81\\Integration\\Models'), - $container->get(TypeGenerator::class), - $container->get(InputTypeGenerator::class), - $container->get(InputTypeUtils::class), - $container->get(BasicAutoWiringContainer::class), - $container->get(AnnotationReader::class), - $container->get(NamingStrategyInterface::class), - $container->get(RecursiveTypeMapperInterface::class), - new Psr16Cache($arrayAdapter), - ); - }; - } - $container = new LazyContainer($overloadedServices + $services); $container->get(TypeResolver::class)->registerSchema($container->get(Schema::class)); $container->get(TypeMapperInterface::class)->addTypeMapper($container->get(GlobTypeMapper::class)); $container->get(TypeMapperInterface::class)->addTypeMapper($container->get(GlobTypeMapper::class . '2')); - if (interface_exists(UnitEnum::class)) { - $container->get(TypeMapperInterface::class)->addTypeMapper($container->get(GlobTypeMapper::class . '3')); - } $container->get(TypeMapperInterface::class)->addTypeMapper($container->get(PorpaginasTypeMapper::class)); $container->get('topRootTypeMapper')->setNext($container->get('rootTypeMapper')); - /*$container->get(CompositeRootTypeMapper::class)->addRootTypeMapper(new CompoundTypeMapper($container->get(RootTypeMapperInterface::class), $container->get(TypeRegistry::class), $container->get(RecursiveTypeMapperInterface::class))); - $container->get(CompositeRootTypeMapper::class)->addRootTypeMapper(new IteratorTypeMapper($container->get(RootTypeMapperInterface::class), $container->get(TypeRegistry::class), $container->get(RecursiveTypeMapperInterface::class))); - $container->get(CompositeRootTypeMapper::class)->addRootTypeMapper(new IteratorTypeMapper($container->get(RootTypeMapperInterface::class), $container->get(TypeRegistry::class), $container->get(RecursiveTypeMapperInterface::class))); - $container->get(CompositeRootTypeMapper::class)->addRootTypeMapper(new MyCLabsEnumTypeMapper()); - $container->get(CompositeRootTypeMapper::class)->addRootTypeMapper(new BaseTypeMapper($container->get(RecursiveTypeMapperInterface::class), $container->get(RootTypeMapperInterface::class))); -*/ + return $container; } @@ -390,4 +346,4 @@ protected function getSuccessResult(ExecutionResult $result, int $debugFlag = De } return $array['data']; } -} \ No newline at end of file +} diff --git a/tests/Mappers/Parameters/TypeMapperTest.php b/tests/Mappers/Parameters/TypeMapperTest.php index 6a1a148f45..36d66746bc 100644 --- a/tests/Mappers/Parameters/TypeMapperTest.php +++ b/tests/Mappers/Parameters/TypeMapperTest.php @@ -11,7 +11,7 @@ use Symfony\Component\Cache\Psr16Cache; use TheCodingMachine\GraphQLite\AbstractQueryProviderTest; use TheCodingMachine\GraphQLite\Annotations\HideParameter; -use TheCodingMachine\GraphQLite\Fixtures80\UnionOutputType; +use TheCodingMachine\GraphQLite\Fixtures\UnionOutputType; use TheCodingMachine\GraphQLite\Mappers\CannotMapTypeException; use TheCodingMachine\GraphQLite\Parameters\DefaultValueParameter; use TheCodingMachine\GraphQLite\Parameters\InputTypeParameter; @@ -39,9 +39,6 @@ public function testMapScalarUnionException(): void $typeMapper->mapReturnType($refMethod, $docBlockObj); } - /** - * @requires PHP >= 8.0 - */ public function testMapObjectUnionWorks(): void { $cachedDocBlockFactory = $this->getCachedDocBlockFactory(); @@ -66,9 +63,7 @@ public function testMapObjectUnionWorks(): void $this->assertEquals('TestObject', $unionTypes[0]->name); $this->assertEquals('TestObject2', $unionTypes[1]->name); } - /** - * @requires PHP >= 8.0 - */ + public function testMapObjectNullableUnionWorks(): void { $cachedDocBlockFactory = $this->getCachedDocBlockFactory(); diff --git a/tests/Types/InputTypeTest.php b/tests/Types/InputTypeTest.php index ba36457e97..be46fdc24b 100644 --- a/tests/Types/InputTypeTest.php +++ b/tests/Types/InputTypeTest.php @@ -46,9 +46,6 @@ public function testInputConfiguredCorrectly(): void $this->assertNotInstanceOf(NonNull::class, $fields['bar']->getType()); } - /** - * @requires PHP >= 7.4 - */ public function testInputConfiguredCorrectlyWithTypedProperties(): void { $input = new InputType(TypedFooBar::class, 'TypedFooBarInput', 'Test', false, $this->getFieldsBuilder());