Skip to content

Commit

Permalink
Merge pull request #1 from Jakub-Fajkus/upgrade-nette
Browse files Browse the repository at this point in the history
Create a constant for the `_extends` string.
  • Loading branch information
Spamercz authored May 31, 2021
2 parents 0b82c34 + 462f711 commit ab4634a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Kdyby/RabbitMq/DI/RabbitMqExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class RabbitMqExtension extends \Nette\DI\CompilerExtension
public const TAG_CONSUMER = 'kdyby.rabbitmq.consumer';
public const TAG_RPC_CLIENT = 'kdyby.rabbitmq.rpc.client';
public const TAG_RPC_SERVER = 'kdyby.rabbitmq.rpc.server';
public const EXTENDS_KEY = '_extends';

/**
* @var array
Expand Down Expand Up @@ -466,8 +467,8 @@ private function extendConsumerFromProducer(string &$consumerName, array $config
$consumerName,
'~^(?P<consumerName>[^>\s]+)\s*\<\s*(?P<producerName>[^>\s]+)\z~'
);
if (isset($config['_extends'])) {
$producerName = $config['_extends'];
if (isset($config[self::EXTENDS_KEY])) {
$producerName = $config[self::EXTENDS_KEY];

} elseif ($m) {
$consumerName = $m['consumerName'];
Expand Down

0 comments on commit ab4634a

Please sign in to comment.