21 private $booleanUtils;
28 private $defaultValueProvider;
38 $this->booleanUtils = $booleanUtils;
39 $this->defaultValueProvider = $defaultValueProvider;
49 foreach (
$source->getElementsByTagName(
'publisher') as $publisherConfig) {
50 $topic = $this->getAttributeValue($publisherConfig,
'topic');
54 foreach ($publisherConfig->childNodes as $connectionConfig) {
55 if ($connectionConfig->nodeName !=
'connection' || $connectionConfig->nodeType != XML_ELEMENT_NODE) {
58 $connectionName = $this->getAttributeValue($connectionConfig,
'name');
59 if (!$connectionName) {
60 throw new \InvalidArgumentException(
'Connection name is missing');
62 $exchangeName = $this->getAttributeValue(
65 $this->defaultValueProvider->getExchange()
67 $isDisabled = $this->getAttributeValue($connectionConfig,
'disabled',
false);
68 $connections[$connectionName] = [
69 'name' => $connectionName,
70 'exchange' => $exchangeName,
71 'disabled' => $this->booleanUtils->toBoolean($isDisabled),
74 $isDisabled = $this->getAttributeValue($publisherConfig,
'disabled',
false);
77 'disabled' => $this->booleanUtils->toBoolean($isDisabled),
78 'connections' => $connections,
93 private function getAttributeValue(\DOMNode $node, $attributeName, $default =
null)
95 $item = $node->attributes->getNamedItem($attributeName);
__construct(BooleanUtils $booleanUtils, DefaultValueProvider $defaultValueProvider)