CleanupPass   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 2
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 12 6
1
<?php
2
3
namespace GoetasWebservices\SoapServices\SoapClient\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
class CleanupPass implements CompilerPassInterface
9
{
10 2
    public function process(ContainerBuilder $container)
11
    {
12
        // if there are no metadata, then we are in debug mode, no need to clean up the container
13 2
        if (!$container->getParameter('goetas_webservices.soap_client.metadata')) {
14 2
            return;
15
        }
16 1
        foreach ($container->getDefinitions() as $id => $definition) {
17 1
            if (strpos($id, 'goetas_webservices.soap_client.metadata_loader.array') === false && !$definition->isSynthetic() && $definition->isPublic()) {
18 1
                $definition->setPublic(false);
19 1
            }
20 1
        }
21 1
    }
22
}
23