Psr4PathGenerator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
nc 1
cc 1
eloc 2
nop 1
crap 1
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