/** * @param \Envariable\DotEnvConfigProcessor|null $dotEnvConfigProcessor * @param \Envariable\ConfigLoader|null $configLoader * @param \Envariable\EnvironmentDetector|null $environmentDetector * @param \Envariable\Util\Server|null $server * @param \Envariable\Util\Filesystem|null $filesystem */ public function __construct(DotEnvConfigProcessor $dotEnvConfigProcessor = null, ConfigLoader $configLoader = null, EnvironmentDetector $environmentDetector = null, Server $server = null, Filesystem $filesystem = null) { $this->dotEnvConfigProcessor = $dotEnvConfigProcessor ?: new DotEnvConfigProcessor(); $this->configLoader = $configLoader ?: new ConfigLoader(); $this->environmentDetector = $environmentDetector ?: new EnvironmentDetector(); $this->server = $server ?: new Server(); $this->filesystem = $filesystem ?: new Filesystem(); $configCreator = new ConfigCreator(); $configCreator->setFilesystem($this->filesystem); $this->configLoader->setFilesystem($this->filesystem); $this->configLoader->setConfigCreator($configCreator); $frameworkConfigPathLocatorCommandList = array(new CodeIgniterConfigPathLocatorCommand()); foreach ($frameworkConfigPathLocatorCommandList as $command) { $command->setFilesystem($this->filesystem); $this->configLoader->addCommand($command); } }