Skip to content

Commit

Permalink
Fixed constants names
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag authored and fprochazka committed Jun 14, 2015
1 parent e3a1907 commit 959f0f4
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Kdyby/Console/DI/ConsoleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
*/
class ConsoleExtension extends Nette\DI\CompilerExtension
{
/** @deprecated */
const HELPER_TAG = self::TAG_HELPER;
/** @deprecated */
const COMMAND_TAG = self::TAG_COMMAND;

const HELPER_TAG = 'kdyby.console.helper';
const COMMAND_TAG = 'kdyby.console.command';
const TAG_HELPER = 'kdyby.console.helper';
const TAG_COMMAND = 'kdyby.console.command';

/**
* @var array
Expand Down Expand Up @@ -81,7 +85,7 @@ public function loadConfiguration()

$builder->addDefinition($this->prefix('dicHelper'))
->setClass('Kdyby\Console\ContainerHelper')
->addTag(self::HELPER_TAG, 'dic');
->addTag(self::TAG_HELPER, 'dic');

if ($config['disabled']) {
return;
Expand All @@ -105,7 +109,7 @@ public function loadConfiguration()

$def->setAutowired(FALSE);
$def->setInject(FALSE);
$def->addTag(self::COMMAND_TAG);
$def->addTag(self::TAG_COMMAND);
}
}

Expand Down Expand Up @@ -148,12 +152,12 @@ public function beforeCompile()
}

$helperSet = $builder->getDefinition($this->prefix('helperSet'));
foreach ($builder->findByTag(self::HELPER_TAG) as $serviceName => $value) {
foreach ($builder->findByTag(self::TAG_HELPER) as $serviceName => $value) {
$helperSet->addSetup('set', array('@' . $serviceName, $value));
}

$app = $builder->getDefinition($this->prefix('application'));
foreach (array_keys($builder->findByTag(self::COMMAND_TAG)) as $serviceName) {
foreach (array_keys($builder->findByTag(self::TAG_COMMAND)) as $serviceName) {
$app->addSetup('add', array('@' . $serviceName));
}

Expand Down

0 comments on commit 959f0f4

Please sign in to comment.