CdnResolverFactory::getKey()   A
last analyzed

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
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
 * Class CdnResolverFactory
15
 *
16
 * @author jobou
17
 * @package Jb\Bundle\FileUploaderBundle\DependencyInjection\ResolverFactory
18
 */
19
class CdnResolverFactory implements ResolverFactoryInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function getKey()
25
    {
26
        return 'cdn';
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function addConfiguration(ArrayNodeDefinition $node)
33
    {
34
        $node
35
            ->children()
36
                ->scalarNode('url')->isRequired()->cannotBeEmpty()->end()
37
            ->end()
38
        ;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function create(ContainerBuilder $container, $id, array $config)
45
    {
46
        $container
47
            ->setDefinition($id, new DefinitionDecorator('jb_fileuploader.resolver.cdn.prototype'))
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...
48
            ->addArgument($config['url'])
49
        ;
50
    }
51
}
52