Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Module/NetteDIModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class NetteDIModule extends Module

/** @var callable[] function(Container $container): void; */
public $onCreateContainer = [];

/** @var array */
Copy link
Member

@f3l1x f3l1x Mar 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/** @var array */
/** @var mixed[] */

public $parameters = [];

/** @var mixed[] */
protected $config = [
Expand Down Expand Up @@ -129,11 +132,13 @@ private function createContainer(): void
$configurator->enableDebugger($logDir);
}

$configurator->addParameters([
$parameters = array_merge($this->parameters, [
'appDir' => $this->path . ($this->config['appDir'] !== null ? '/' . $this->config['appDir'] : ''),
'wwwDir' => $this->path . ($this->config['wwwDir'] !== null ? '/' . $this->config['wwwDir'] : ''),
]);

$configurator->addParameters($parameters);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still very limiting. Please split createContainer into createConfigurator and createContainer. Should work like that: create and configure configurator, run onCreateConfigurator events, create container, run onCreateContainer events


$this->clearTempDir();
$tempDir = $this->getTempDir();
$configurator->setTempDirectory($tempDir);
Expand Down