Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BindingInstaller.php
Go to the documentation of this file.
1 <?php
7 
9 use PhpAmqpLib\Channel\AMQPChannel;
10 
15 {
19  private $installers;
20 
26  public function __construct(array $installers)
27  {
28  $this->installers = $installers;
29  }
30 
34  public function install(AMQPChannel $channel, BindingInterface $binding, $exchangeName)
35  {
36  $this->getInstaller($binding->getDestinationType())->install($channel, $binding, $exchangeName);
37  }
38 
45  private function getInstaller($type)
46  {
47  if (!isset($this->installers[$type])) {
48  throw new \InvalidArgumentException(sprintf('Installer type [%s] is not configured', $type));
49  }
50  return $this->installers[$type];
51  }
52 }
$type
Definition: item.phtml:13
install(AMQPChannel $channel, BindingInterface $binding, $exchangeName)