From 6d7cd5f64fca221ef1d2d7223287962167c6c365 Mon Sep 17 00:00:00 2001 From: MartkCz Date: Wed, 18 Apr 2018 13:43:51 +0200 Subject: [PATCH] Nette/DI/ContainerBuilder::expand() is deprecated --- src/DI/OrmAnnotationsExtension.php | 5 +++-- src/DI/OrmCacheExtension.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/DI/OrmAnnotationsExtension.php b/src/DI/OrmAnnotationsExtension.php index c199c90..dd4a9f0 100644 --- a/src/DI/OrmAnnotationsExtension.php +++ b/src/DI/OrmAnnotationsExtension.php @@ -9,6 +9,7 @@ use Doctrine\Common\Cache\FilesystemCache; use Doctrine\ORM\Configuration; use Nette\DI\CompilerExtension; +use Nette\DI\Helpers; use Nette\InvalidStateException; use Nette\PhpGenerator\ClassType; use Nette\PhpGenerator\PhpLiteral; @@ -54,7 +55,7 @@ public function loadConfiguration(): void // Cache $builder->addDefinition($this->prefix('annotationsCache')) - ->setFactory($config['cache'], [$builder->expand($config['cacheDir'])]); + ->setFactory($config['cache'], [Helpers::expand($config['cacheDir'], $builder->parameters)]); //TODO otestovat predani @... @@ -66,7 +67,7 @@ public function loadConfiguration(): void ]); $builder->addDefinition($this->prefix('annotationDriver')) - ->setClass(AnnotationDriver::class, [$this->prefix('@reader'), $builder->expand($config['paths'])]); + ->setClass(AnnotationDriver::class, [$this->prefix('@reader'), Helpers::expand($config['paths'], $builder->parameters)]); $builder->getDefinitionByType(Configuration::class) ->addSetup('setMetadataDriverImpl', [$this->prefix('@annotationDriver')]); diff --git a/src/DI/OrmCacheExtension.php b/src/DI/OrmCacheExtension.php index b3e7574..378a5db 100644 --- a/src/DI/OrmCacheExtension.php +++ b/src/DI/OrmCacheExtension.php @@ -119,7 +119,7 @@ protected function getDriverCache(string $service): ServiceDefinition ->setFactory($config['driver']); if (is_subclass_of($config['driver'], FilesystemCache::class)) { - $driverCache->setArguments([$builder->expand('%tempDir%/cache/Doctrine.' . ucfirst($service))]); + $driverCache->setArguments([$builder->parameters['tempDir'] . '/cache/Doctrine.' . ucfirst($service)]); } return $driverCache; }