Completed
Push — master ( ccd20f...6ee4e9 )
by dan
02:09
created

SlackBroadcasterFactory::getKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace IrishDan\NotificationBundle\DependencyInjection\Factory\Broadcaster;
4
5
use IrishDan\NotificationBundle\DependencyInjection\Factory\BroadcasterFactoryInterface;
6
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
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 View Code Duplication
    public function create(ContainerBuilder $container, $id, array $config)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
    {
20
        $container
21
            ->setDefinition($id, new DefinitionDecorator('notification.broadcaster.slack'))
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\Depend...ion\DefinitionDecorator has been deprecated with message: The DefinitionDecorator class is deprecated since version 3.3 and will be removed in 4.0. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
22
            ->replaceArgument(0, new Reference(sprintf('notification.%s_adapter', $config['adapter'])))
23
            // ->replaceArgument(1, $config['key'])
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
24
            // ->replaceArgument(2, $config['expires'])
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
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