| @@ 11-38 (lines=28) @@ | ||
| 8 | use Symfony\Component\DependencyInjection\DefinitionDecorator; |
|
| 9 | use Symfony\Component\DependencyInjection\Reference; |
|
| 10 | ||
| 11 | class SlackBroadcasterFactory implements BroadcasterFactoryInterface |
|
| 12 | { |
|
| 13 | public function getKey() |
|
| 14 | { |
|
| 15 | return 'slack'; |
|
| 16 | } |
|
| 17 | ||
| 18 | public function create(ContainerBuilder $container, $id, array $config) |
|
| 19 | { |
|
| 20 | $container |
|
| 21 | ->setDefinition($id, new DefinitionDecorator('notification.broadcaster.slack')) |
|
| 22 | ->replaceArgument(0, new Reference(sprintf('notification.%s_adapter', $config['adapter']))) |
|
| 23 | // ->replaceArgument(1, $config['key']) |
|
| 24 | // ->replaceArgument(2, $config['expires']) |
|
| 25 | ; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function addConfiguration(NodeDefinition $node) |
|
| 29 | { |
|
| 30 | // $node |
|
| 31 | // ->children() |
|
| 32 | // // ->scalarNode('adapter')->isRequired()->end() |
|
| 33 | // // ->scalarNode('key')->defaultValue('flysystem')->end() |
|
| 34 | // // ->scalarNode('expires')->defaultNull()->end() |
|
| 35 | // ->end() |
|
| 36 | // ; |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| @@ 11-38 (lines=28) @@ | ||
| 8 | use Symfony\Component\DependencyInjection\DefinitionDecorator; |
|
| 9 | use Symfony\Component\DependencyInjection\Reference; |
|
| 10 | ||
| 11 | class SlackBroadcasterFactory implements BroadcasterFactoryInterface |
|
| 12 | { |
|
| 13 | public function getKey() |
|
| 14 | { |
|
| 15 | return 'slack'; |
|
| 16 | } |
|
| 17 | ||
| 18 | public function create(ContainerBuilder $container, $id, array $config) |
|
| 19 | { |
|
| 20 | $container |
|
| 21 | ->setDefinition($id, new DefinitionDecorator('notification.broadcaster.slack')) |
|
| 22 | ->replaceArgument(0, new Reference(sprintf('notification.%s_adapter', $config['adapter']))) |
|
| 23 | // ->replaceArgument(1, $config['key']) |
|
| 24 | // ->replaceArgument(2, $config['expires']) |
|
| 25 | ; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function addConfiguration(NodeDefinition $node) |
|
| 29 | { |
|
| 30 | // $node |
|
| 31 | // ->children() |
|
| 32 | // // ->scalarNode('adapter')->isRequired()->end() |
|
| 33 | // // ->scalarNode('key')->defaultValue('flysystem')->end() |
|
| 34 | // // ->scalarNode('expires')->defaultNull()->end() |
|
| 35 | // ->end() |
|
| 36 | // ; |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||