Skip to content

Commit eec489d

Browse files
committed
No need to use kdyby anymore. Could use for example contributte/console :) But require symfony/console in composer.json
1 parent 6966671 commit eec489d

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
},
2525
"require": {
2626
"bunny/bunny": "^0.2.4",
27-
"kdyby/console": "~2.6.0|~2.7.0"
27+
"symfony/console": "~3.3"
2828
}
2929
}

src/DI/RabbitMQExtension.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Gamee\RabbitMQ\DI\Helpers\ProducersHelper;
2020
use Gamee\RabbitMQ\DI\Helpers\QueuesHelper;
2121
use Gamee\RabbitMQ\Queue\QueueFactory;
22-
use Kdyby;
2322
use Nette\DI\CompilerExtension;
2423
use Nette\DI\ServiceDefinition;
2524

@@ -125,13 +124,16 @@ public function setupConsoleCommand(): void
125124
{
126125
$builder = $this->getContainerBuilder();
127126

128-
$builder->addDefinition($this->prefix('console.consumerCommand'))
129-
->setClass(ConsumerCommand::class)
130-
->addTag(Kdyby\Console\DI\ConsoleExtension::TAG_COMMAND);
127+
$consumerCommand = $builder->addDefinition($this->prefix('console.consumerCommand'))
128+
->setClass(ConsumerCommand::class);
131129

132-
$builder->addDefinition($this->prefix('console.staticConsumerCommand'))
133-
->setClass(StaticConsumerCommand::class)
134-
->addTag(Kdyby\Console\DI\ConsoleExtension::TAG_COMMAND);
130+
$staticConsumerCommand = $builder->addDefinition($this->prefix('console.staticConsumerCommand'))
131+
->setClass(StaticConsumerCommand::class);
132+
133+
if (class_exists('Kdyby\Console\DI\ConsoleExtension')) {
134+
$consumerCommand->addTag(\Kdyby\Console\DI\ConsoleExtension::TAG_COMMAND);
135+
$staticConsumerCommand->addTag(\Kdyby\Console\DI\ConsoleExtension::TAG_COMMAND);
136+
}
135137
}
136138

137139
}

0 commit comments

Comments
 (0)