for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of Symplify
* Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
*/
namespace Symplify\PHP7_Sculpin\DI;
use Nette\Configurator;
use Nette\DI\Container;
use Nette\Utils\FileSystem;
final class ContainerFactory
{
public function create() : Container
$configurator = new Configurator();
$configurator->setTempDirectory($this->createAndReturnTempDir());
$configurator->addConfig(__DIR__.'/../config/default.neon');
$container = $configurator->createContainer();
return $container;
}
private function createAndReturnTempDir() : string
$tempDir = sys_get_temp_dir() . '/php7_sculpin';
FileSystem::delete($tempDir);
FileSystem::createDir($tempDir);
return $tempDir;