Completed
Push — master ( 2a83dc...50197b )
by Jonathan
9s
created

CdnResolverFactory::getKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
4
/**
5
 * @namespace
6
 */
7
namespace Jb\Bundle\FileUploaderBundle\DependencyInjection\ResolverFactory;
8
9
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
use Symfony\Component\DependencyInjection\DefinitionDecorator;
12
13
/**
14
 * CdnResolverFactory
15
 *
16
 * @author jobou
17
 */
18 View Code Duplication
class CdnResolverFactory implements ResolverFactoryInterface
0 ignored issues
show
Duplication introduced by
This class 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
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getKey()
24
    {
25
        return 'cdn';
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function addConfiguration(ArrayNodeDefinition $node)
32
    {
33
        $node
34
            ->children()
35
                ->scalarNode('url')->isRequired()->cannotBeEmpty()->end()
36
            ->end()
37
        ;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function create(ContainerBuilder $container, $id, array $config)
44
    {
45
        $container
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\Depend...\Definition::setScope() has been deprecated with message: since version 2.8, to be removed in 3.0.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

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

Loading history...
46
            ->setDefinition($id, new DefinitionDecorator('jb_fileuploader.resolver.cdn.prototype'))
47
            ->setScope('request')
48
            ->addArgument($config['url'])
49
        ;
50
    }
51
}
52