Completed
Pull Request — 1.0 (#875)
by Rob
02:22
created

LocatorsCompilerPass::process()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
rs 9.4285
c 1
b 0
f 0
cc 3
eloc 4
nc 3
nop 1
1
<?php
2
3
/*
4
 * This file is part of the `liip/LiipImagineBundle` project.
5
 *
6
 * (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Liip\ImagineBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
16
class LocatorsCompilerPass extends AbstractCompilerPass
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function process(ContainerBuilder $container)
22
    {
23
        foreach ($container->findTaggedServiceIds('liip_imagine.binary.locator') as $id => $tags) {
24
            if (isset($tags[0]['shared'])) {
25
                $this->setDefinitionSharing($container->getDefinition($id), $tags[0]['shared']);
26
            }
27
        }
28
    }
29
}
30