Skip to content

Commit

Permalink
- Fixing extension definition
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Nov 9, 2019
1 parent a3854ae commit 587a55f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/IPub/MQTTClient/DI/MQTTClientExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
use Nette\DI;
use Nette\PhpGenerator as Code;

use Kdyby\Console;

use BinSoul\Net\Mqtt;

use React;
Expand Down Expand Up @@ -80,12 +78,14 @@ final class MQTTClientExtension extends DI\CompilerExtension
*/
public function loadConfiguration()
{
parent::loadConfiguration();

/** @var DI\ContainerBuilder $builder */
// Get container builder
$builder = $this->getContainerBuilder();
/** @var array $configuration */
$configuration = $this->getConfig($this->defaults);

// Merge extension default config
$this->setConfig(DI\Config\Helpers::merge($this->config, DI\Helpers::expand($this->defaults, $builder->parameters)));

// Get extension configuration
$configuration = $this->getConfig();

if ($configuration['loop'] === NULL) {
if ($builder->getByType(React\EventLoop\LoopInterface::class) === NULL) {
Expand Down Expand Up @@ -141,8 +141,7 @@ public function loadConfiguration()

foreach ($commands as $name => $cmd) {
$builder->addDefinition($this->prefix('commands' . lcfirst($name)))
->setType($cmd)
->addTag(Console\DI\ConsoleExtension::TAG_COMMAND);
->setType($cmd);
}
}

Expand Down

0 comments on commit 587a55f

Please sign in to comment.