Completed
Push — master ( 030796...0c67b5 )
by Asmir
30:13
created

CleanupPass::process()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 6
nc 4
nop 1
1
<?php
2
namespace GoetasWebservices\SoapServices\SoapClient\DependencyInjection\Compiler;
3
4
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
7
class CleanupPass implements CompilerPassInterface
8
{
9
    public function process(ContainerBuilder $container)
10
    {
11
        if (!$container->getParameter('goetas.soap_client.metadata')) {
12
            return;
13
        }
14
        foreach ($container->getDefinitions() as $id => $definition) {
15
            if (strpos($id, 'goetas.soap_client.metadata_reader') === false && !$definition->isSynthetic()) {
16
                $definition->setPublic(false);
17
            }
18
        }
19
    }
20
}
21