Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"doctrine/coding-standard": "^13.0",
"ecodev/graphql-upload": "^7.0",
"laminas/laminas-diactoros": "^3.5",
"myclabs/php-enum": "^1.6.6",
"php-coveralls/php-coveralls": "^2.7",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.0",
Expand Down
6 changes: 0 additions & 6 deletions src/AnnotationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use ReflectionProperty;
use TheCodingMachine\GraphQLite\Annotations\AbstractRequest;
use TheCodingMachine\GraphQLite\Annotations\Decorate;
use TheCodingMachine\GraphQLite\Annotations\EnumType;
use TheCodingMachine\GraphQLite\Annotations\Exceptions\ClassNotFoundException;
use TheCodingMachine\GraphQLite\Annotations\Exceptions\InvalidParameterException;
use TheCodingMachine\GraphQLite\Annotations\ExtendType;
Expand Down Expand Up @@ -196,11 +195,6 @@ public function getExtendTypeAnnotation(ReflectionClass $refClass): ExtendType|n
return $extendType;
}

public function getEnumTypeAnnotation(ReflectionClass $refClass): EnumType|null
{
return $this->getClassAnnotation($refClass, EnumType::class);
}

/** @param class-string<AbstractRequest> $annotationClass */
public function getRequestAnnotation(ReflectionMethod $refMethod, string $annotationClass): AbstractRequest|null
{
Expand Down
48 changes: 0 additions & 48 deletions src/Annotations/EnumType.php

This file was deleted.

7 changes: 1 addition & 6 deletions src/Mappers/Root/EnumTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use GraphQL\Type\Definition\NamedType;
use GraphQL\Type\Definition\OutputType;
use GraphQL\Type\Definition\Type as GraphQLType;
use MyCLabs\Enum\Enum;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\Object_;
Expand Down Expand Up @@ -104,16 +103,12 @@ private function mapByClassName(string $enumClass): EnumType|null
if (! enum_exists($enumClass)) {
return null;
}
/** @var class-string<Enum> $enumClass */
/** @var class-string<UnitEnum> $enumClass */
$enumClass = ltrim($enumClass, '\\');
if (isset($this->cacheByClass[$enumClass])) {
return $this->cacheByClass[$enumClass];
}

// phpcs:disable SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable
/** @var class-string<UnitEnum> $enumClass */
// phpcs:enable SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable

$reflectionEnum = new ReflectionEnum($enumClass);

$typeAnnotation = $this->annotationReader->getTypeAnnotation($reflectionEnum);
Expand Down
174 changes: 0 additions & 174 deletions src/Mappers/Root/MyCLabsEnumTypeMapper.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/SchemaFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Kcs\ClassFinder\FileFinder\DefaultFileFinder;
use Kcs\ClassFinder\Finder\ComposerFinder;
use Kcs\ClassFinder\Finder\FinderInterface;
use MyCLabs\Enum\Enum;
use PackageVersions\Versions;
use Psr\Container\ContainerInterface;
use Psr\SimpleCache\CacheInterface;
Expand Down Expand Up @@ -41,7 +40,6 @@
use TheCodingMachine\GraphQLite\Mappers\Root\FinalRootTypeMapper;
use TheCodingMachine\GraphQLite\Mappers\Root\IteratorTypeMapper;
use TheCodingMachine\GraphQLite\Mappers\Root\LastDelegatingTypeMapper;
use TheCodingMachine\GraphQLite\Mappers\Root\MyCLabsEnumTypeMapper;
use TheCodingMachine\GraphQLite\Mappers\Root\NullableTypeMapperAdapter;
use TheCodingMachine\GraphQLite\Mappers\Root\RootTypeMapperFactoryContext;
use TheCodingMachine\GraphQLite\Mappers\Root\RootTypeMapperFactoryInterface;
Expand Down Expand Up @@ -70,7 +68,6 @@
use TheCodingMachine\GraphQLite\Utils\NamespacedCache;

use function array_reverse;
use function class_exists;
use function implode;
use function md5;
use function substr;
Expand Down Expand Up @@ -406,11 +403,6 @@ public function createSchema(): Schema
$rootTypeMapper = new BaseTypeMapper($errorRootTypeMapper, $recursiveTypeMapper, $topRootTypeMapper);
$rootTypeMapper = new EnumTypeMapper($rootTypeMapper, $annotationReader, $docBlockFactory, $classFinder, $classFinderComputedCache);

if (class_exists(Enum::class)) {
// Annotation support - deprecated
$rootTypeMapper = new MyCLabsEnumTypeMapper($rootTypeMapper, $annotationReader, $classFinder, $classFinderComputedCache);
}

if (! empty($this->rootTypeMapperFactories)) {
$rootSchemaFactoryContext = new RootTypeMapperFactoryContext(
$annotationReader,
Expand Down
40 changes: 0 additions & 40 deletions src/Types/MyCLabsEnumType.php

This file was deleted.

9 changes: 0 additions & 9 deletions tests/AbstractQueryProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
use TheCodingMachine\GraphQLite\Mappers\Root\FinalRootTypeMapper;
use TheCodingMachine\GraphQLite\Mappers\Root\IteratorTypeMapper;
use TheCodingMachine\GraphQLite\Mappers\Root\LastDelegatingTypeMapper;
use TheCodingMachine\GraphQLite\Mappers\Root\MyCLabsEnumTypeMapper;
use TheCodingMachine\GraphQLite\Mappers\Root\NullableTypeMapperAdapter;
use TheCodingMachine\GraphQLite\Mappers\Root\RootTypeMapperInterface;
use TheCodingMachine\GraphQLite\Mappers\Root\VoidTypeMapper;
Expand Down Expand Up @@ -369,14 +368,6 @@ protected function buildRootTypeMapper(): RootTypeMapperInterface
$topRootTypeMapper,
);

// Annotation support - deprecated
$rootTypeMapper = new MyCLabsEnumTypeMapper(
$rootTypeMapper,
$this->getAnnotationReader(),
new StaticClassFinder([]),
new HardClassFinderComputedCache(new Psr16Cache($arrayAdapter)),
);

$rootTypeMapper = new EnumTypeMapper(
$rootTypeMapper,
$this->getAnnotationReader(),
Expand Down
2 changes: 1 addition & 1 deletion tests/FieldsBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testQueryProvider(): void
'dateTimeImmutable' => '2017-01-01 01:01:01',
'dateTime' => '2017-01-01 01:01:01',
'id' => 42,
'enum' => TestEnum::ON(),
'enum' => TestEnum::ON,
];

$resolve = $usersQuery->resolveFn;
Expand Down
Loading
Loading