From a0a4cbef8945d63a1231a1052ea7f571dc8d603a Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 16 Feb 2024 15:01:04 +0200 Subject: [PATCH] fixes for tests --- config/autoload/doctrine.global.php | 7 ----- config/autoload/local.php.dist | 11 ------- src/App/src/ConfigProvider.php | 29 +++++++++---------- .../src/Factory/AnnotationsCacheFactory.php | 22 -------------- 4 files changed, 13 insertions(+), 56 deletions(-) delete mode 100644 src/App/src/Factory/AnnotationsCacheFactory.php diff --git a/config/autoload/doctrine.global.php b/config/autoload/doctrine.global.php index c999dd5..1367b23 100644 --- a/config/autoload/doctrine.global.php +++ b/config/autoload/doctrine.global.php @@ -2,7 +2,6 @@ declare(strict_types=1); -//use Doctrine\Common\Cache\PhpFileCache; use Doctrine\ORM\Mapping\Driver\AttributeDriver; use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType; @@ -49,12 +48,6 @@ UuidBinaryType::NAME => UuidBinaryType::class, UuidBinaryOrderedTimeType::NAME => UuidBinaryOrderedTimeType::class, ], -// 'cache' => [ -// PhpFileCache::class => [ -// 'class' => PhpFileCache::class, -// 'directory' => getcwd() . '/data/cache/doctrine', -// ], -// ], 'fixtures' => getcwd() . '/data/doctrine/fixtures', ], 'resultCacheLifetime' => 3600, diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist index 854ff23..54b833b 100644 --- a/config/autoload/local.php.dist +++ b/config/autoload/local.php.dist @@ -3,7 +3,6 @@ declare(strict_types=1); use Api\App\Entity\EntityListenerResolver; -use Doctrine\Common\Cache\PhpFileCache; $baseUrl = 'http://localhost:8080'; @@ -53,16 +52,6 @@ return [ 'params' => $databases['default'], ], ], - 'configuration' => [ - 'orm_default' => [ - // it is recommended to disable doctrine cache on development - // just comment any type of cache you don't want to be applied on development - 'query_cache' => PhpFileCache::class, - 'metadata_cache' => PhpFileCache::class, - 'result_cache' => PhpFileCache::class, - 'entity_listener_resolver' => EntityListenerResolver::class, - ], - ], ], 'uploads' => [ 'user' => [ diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index 3d45e4b..c60351c 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -7,7 +7,6 @@ use Api\App\Command\RouteListCommand; use Api\App\Command\TokenGenerateCommand; use Api\App\Entity\EntityListenerResolver; -//use Api\App\Factory\AnnotationsCacheFactory; use Api\App\Factory\AuthenticationMiddlewareFactory; use Api\App\Factory\EntityListenerResolverFactory; use Api\App\Factory\RouteListCommandFactory; @@ -19,7 +18,6 @@ use Api\App\Service\ErrorReportServiceInterface; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; -//use Dot\AnnotatedServices\Factory\AbstractAnnotatedFactory; use Dot\AnnotatedServices\Factory\AnnotatedServiceFactory; use Dot\Mail\Factory\MailOptionsAbstractFactory; use Dot\Mail\Factory\MailServiceAbstractFactory; @@ -60,20 +58,19 @@ public function getDependencies(): array ], ], 'factories' => [ - 'doctrine.entity_manager.orm_default' => EntityManagerFactory::class, - 'dot-mail.options.default' => MailOptionsAbstractFactory::class, - 'dot-mail.service.default' => MailServiceAbstractFactory::class, -// AbstractAnnotatedFactory::CACHE_SERVICE => AnnotationsCacheFactory::class, - AuthenticationMiddleware::class => AuthenticationMiddlewareFactory::class, - AuthorizationMiddleware::class => AnnotatedServiceFactory::class, - Environment::class => TwigEnvironmentFactory::class, - TwigExtension::class => TwigExtensionFactory::class, - TwigRenderer::class => TwigRendererFactory::class, - ErrorResponseMiddleware::class => AnnotatedServiceFactory::class, - RouteListCommand::class => RouteListCommandFactory::class, - TokenGenerateCommand::class => TokenGenerateCommandFactory::class, - ErrorReportService::class => AnnotatedServiceFactory::class, - EntityListenerResolver::class => EntityListenerResolverFactory::class, + 'doctrine.entity_manager.orm_default' => EntityManagerFactory::class, + 'dot-mail.options.default' => MailOptionsAbstractFactory::class, + 'dot-mail.service.default' => MailServiceAbstractFactory::class, + AuthenticationMiddleware::class => AuthenticationMiddlewareFactory::class, + AuthorizationMiddleware::class => AnnotatedServiceFactory::class, + Environment::class => TwigEnvironmentFactory::class, + TwigExtension::class => TwigExtensionFactory::class, + TwigRenderer::class => TwigRendererFactory::class, + ErrorResponseMiddleware::class => AnnotatedServiceFactory::class, + RouteListCommand::class => RouteListCommandFactory::class, + TokenGenerateCommand::class => TokenGenerateCommandFactory::class, + ErrorReportService::class => AnnotatedServiceFactory::class, + EntityListenerResolver::class => EntityListenerResolverFactory::class, ], 'aliases' => [ Authentication\AuthenticationInterface::class => Authentication\OAuth2\OAuth2Adapter::class, diff --git a/src/App/src/Factory/AnnotationsCacheFactory.php b/src/App/src/Factory/AnnotationsCacheFactory.php deleted file mode 100644 index b917229..0000000 --- a/src/App/src/Factory/AnnotationsCacheFactory.php +++ /dev/null @@ -1,22 +0,0 @@ -get('config')['annotations_cache_dir']); - } -}