Skip to content

Commit 9579ad7

Browse files
authored
Merge pull request #110 from lingoda/drop-doctrine-cache
Drop doctrine/cache dependency
2 parents 5b4787a + c98b753 commit 9579ad7

File tree

2 files changed

+5
-33
lines changed

2 files changed

+5
-33
lines changed

DependencyInjection/GraphqliteCompilerPass.php

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace TheCodingMachine\Graphqlite\Bundle\DependencyInjection;
55

6+
use Doctrine\Common\Annotations\PsrCachedReader;
67
use GraphQL\Server\ServerConfig;
78
use GraphQL\Validator\Rules\DisableIntrospection;
89
use GraphQL\Validator\Rules\QueryComplexity;
@@ -11,43 +12,29 @@
1112
use Symfony\Component\Cache\Adapter\ApcuAdapter;
1213
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
1314
use Symfony\Component\Cache\Psr16Cache;
14-
use TheCodingMachine\GraphQLite\Mappers\StaticClassListTypeMapper;
1515
use TheCodingMachine\GraphQLite\Mappers\StaticClassListTypeMapperFactory;
1616
use Webmozart\Assert\Assert;
1717
use function class_exists;
18-
use Doctrine\Common\Annotations\AnnotationException;
1918
use Doctrine\Common\Annotations\AnnotationReader as DoctrineAnnotationReader;
2019
use Doctrine\Common\Annotations\AnnotationRegistry;
21-
use Doctrine\Common\Annotations\CachedReader;
22-
use Doctrine\Common\Cache\ApcuCache;
23-
use function error_log;
2420
use Mouf\Composer\ClassNameMapper;
2521
use Psr\SimpleCache\CacheInterface;
2622
use ReflectionParameter;
27-
use Symfony\Component\Cache\Simple\ApcuCache as SymfonyApcuCache;
28-
use Symfony\Component\Cache\Simple\PhpFilesCache as SymfonyPhpFilesCache;
2923
use function filter_var;
3024
use function function_exists;
31-
use GraphQL\Type\Definition\InputObjectType;
32-
use GraphQL\Type\Definition\ObjectType;
33-
use Psr\Container\ContainerInterface;
3425
use ReflectionClass;
3526
use ReflectionMethod;
3627
use function ini_get;
3728
use function interface_exists;
38-
use function php_sapi_name;
39-
use function str_replace;
4029
use function strpos;
4130
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
4231
use Symfony\Component\DependencyInjection\ContainerBuilder;
4332
use Symfony\Component\DependencyInjection\Definition;
4433
use Symfony\Component\DependencyInjection\Reference;
45-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
4634
use Symfony\Component\HttpFoundation\Session\SessionInterface;
4735
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
4836
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
4937
use Symfony\Component\Security\Core\User\UserInterface;
50-
use Symfony\Component\Security\Core\User\UserProviderInterface;
5138
use TheCodingMachine\CacheUtils\ClassBoundCache;
5239
use TheCodingMachine\CacheUtils\ClassBoundCacheContract;
5340
use TheCodingMachine\CacheUtils\ClassBoundCacheContractInterface;
@@ -56,30 +43,15 @@
5643
use TheCodingMachine\ClassExplorer\Glob\GlobClassExplorer;
5744
use TheCodingMachine\GraphQLite\AggregateControllerQueryProviderFactory;
5845
use TheCodingMachine\GraphQLite\AnnotationReader;
59-
use TheCodingMachine\GraphQLite\Annotations\AbstractRequest;
6046
use TheCodingMachine\GraphQLite\Annotations\Autowire;
6147
use TheCodingMachine\GraphQLite\Annotations\Field;
6248
use TheCodingMachine\GraphQLite\Annotations\Mutation;
63-
use TheCodingMachine\GraphQLite\Annotations\Parameter;
6449
use TheCodingMachine\GraphQLite\Annotations\Query;
6550
use TheCodingMachine\Graphqlite\Bundle\Controller\GraphQL\LoginController;
6651
use TheCodingMachine\Graphqlite\Bundle\Controller\GraphQL\MeController;
67-
use TheCodingMachine\GraphQLite\FieldsBuilder;
68-
use TheCodingMachine\GraphQLite\FieldsBuilderFactory;
6952
use TheCodingMachine\GraphQLite\GraphQLRuntimeException as GraphQLException;
70-
use TheCodingMachine\GraphQLite\InputTypeGenerator;
71-
use TheCodingMachine\GraphQLite\InputTypeUtils;
72-
use TheCodingMachine\GraphQLite\Mappers\CompositeTypeMapper;
73-
use TheCodingMachine\GraphQLite\Mappers\GlobTypeMapper;
74-
use TheCodingMachine\GraphQLite\Mappers\RecursiveTypeMapperInterface;
75-
use TheCodingMachine\GraphQLite\Mappers\Root\CompositeRootTypeMapper;
7653
use TheCodingMachine\GraphQLite\Mappers\StaticTypeMapper;
77-
use TheCodingMachine\GraphQLite\NamingStrategy;
7854
use TheCodingMachine\GraphQLite\SchemaFactory;
79-
use TheCodingMachine\GraphQLite\TypeGenerator;
80-
use TheCodingMachine\GraphQLite\Types\MutableObjectType;
81-
use TheCodingMachine\GraphQLite\Types\ResolvableInputObjectType;
82-
use function var_dump;
8355
use TheCodingMachine\Graphqlite\Bundle\Types\SymfonyUserInterfaceType;
8456

8557
/**
@@ -441,10 +413,11 @@ private function getAnnotationReader(): AnnotationReader
441413
{
442414
if ($this->annotationReader === null) {
443415
AnnotationRegistry::registerLoader('class_exists');
416+
444417
$doctrineAnnotationReader = new DoctrineAnnotationReader();
445418

446419
if (function_exists('apcu_fetch')) {
447-
$doctrineAnnotationReader = new CachedReader($doctrineAnnotationReader, new ApcuCache(), true);
420+
$doctrineAnnotationReader = new PsrCachedReader($doctrineAnnotationReader, new ApcuAdapter('graphqlite'), true);
448421
}
449422

450423
$this->annotationReader = new AnnotationReader($doctrineAnnotationReader, AnnotationReader::LAX_MODE);

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
"require" : {
1919
"php" : ">=7.2",
2020
"ext-json": "*",
21-
"thecodingmachine/graphqlite" : "^4.1.2",
21+
"thecodingmachine/graphqlite" : "^4.3",
2222
"thecodingmachine/graphqlite-symfony-validator-bridge" : "^4.1",
2323
"symfony/framework-bundle": "^4.2 || ^5",
2424
"symfony/validator": "^4.2 || ^5",
2525
"symfony/translation": "^4.2 || ^5",
26-
"doctrine/annotations": "^1.10.4",
27-
"doctrine/cache": "^1.8",
26+
"doctrine/annotations": "^1.13",
2827
"symfony/psr-http-message-bridge": "^2.0",
2928
"nyholm/psr7": "^1.1",
3029
"laminas/laminas-diactoros": "^2.2.2",

0 commit comments

Comments
 (0)