$data) { foreach ((array)$data['bindings'] as $binding) { if (isset($data['type']) && $data['type'] == 'topic' && !isset($binding['topic'])) { $errors[] = 'Topic name is required for topic based exchange: ' . $name; } } } if (!empty($errors)) { throw new \LogicException(implode(PHP_EOL, $errors)); } } }