Skip to content

Commit

Permalink
Nette/DI/ContainerBuilder::expand() is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
MartkCz authored and Milan Felix Šulc committed Apr 19, 2018
1 parent 386107e commit 6d7cd5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/DI/OrmAnnotationsExtension.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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 @...

Expand All @@ -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')]);
Expand Down
2 changes: 1 addition & 1 deletion src/DI/OrmCacheExtension.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6d7cd5f

Please sign in to comment.