Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function create(ContainerBuilder $container, $name, array $config) |
||
11 | { |
||
12 | $type = array_keys($config)[0]; |
||
13 | $parameterName = 'notification.broadcast.config.' . $name; |
||
14 | $serviceName = 'notification.broadcast.' . $name; |
||
15 | $channelServiceName = 'notification.channel.' . $type; |
||
16 | |||
17 | $container->setParameter($parameterName, $config[$type]); |
||
18 | |||
19 | $definition = new Definition(); |
||
20 | $definition->setClass('IrishDan\NotificationBundle\Broadcast\Broadcaster'); |
||
21 | $definition->setArguments( |
||
22 | [ |
||
23 | '@notification.broadcast.notifiable', |
||
24 | '@' . $channelServiceName, |
||
25 | '%' . $parameterName . '%', |
||
26 | ] |
||
27 | ); |
||
28 | |||
29 | $container->setDefinition($serviceName, $definition); |
||
30 | } |
||
31 | } |
||
32 |