Psr4PathGenerator::setTargets()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3.1406

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 8
cp 0.75
rs 9.4285
c 0
b 0
f 0
nc 3
cc 3
eloc 5
nop 1
crap 3.1406
1
<?php
2
namespace GoetasWebservices\Xsd\XsdToPhp\PathGenerator;
3
4
abstract class Psr4PathGenerator
5
{
6
7
    protected $namespaces = array();
8
9 6
    public function __construct(array $targets = array())
10
    {
11 6
        $this->setTargets($targets);
12 6
    }
13
14 6
    public function setTargets($namespaces)
15
    {
16 6
        $this->namespaces = $namespaces;
17
18 6
        foreach ($this->namespaces as $namespace => $dir) {
19 6
            if (!is_dir($dir)) {
20
                mkdir($dir, 0777, true);
21
            }
22 6
        }
23 6
    }
24
}
25
26