Completed
Push — dev/product_visibility ( 1ee472 )
by Kiyotaka
06:23
created

ProductVisibilityPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 2
1
<?php
2
/*
3
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.ec-cube.co.jp/
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Eccube\DependencyInjection\Compiler;
14
15
16
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
use Symfony\Component\DependencyInjection\Reference;
19
20
class ProductVisibilityPass implements CompilerPassInterface
21
{
22
    const TAG = 'eccube.product.visibility';
23
24
    public function process(ContainerBuilder $container)
25
    {
26
        $visibilitiesDef = $container->getDefinition('eccube.product.visibilities');
27
        $ids = $container->findTaggedServiceIds(self::TAG);
28
        foreach ($ids as $id => $tag) {
29
            $visibilitiesDef->addMethodCall('append', [new Reference($id)]);
30
        }
31
    }
32
}
33