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

CleanupPass   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B process() 0 11 5
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