Completed
Push — master ( a6f482...e74e5e )
by Maciej
12s
created

FileLocator::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 5
cts 6
cp 0.8333
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2.0185
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ODM\MongoDB\Proxy;
6
7
use ProxyManager\FileLocator\FileLocator as BaseFileLocator;
8
use function mkdir;
9
use function realpath;
10
11
final class FileLocator extends BaseFileLocator
12
{
13 1697
    public function __construct(string $proxiesDirectory)
14
    {
15 1697
        $absolutePath = realpath($proxiesDirectory);
16
17 1697
        if ($absolutePath === false) {
18
            mkdir($proxiesDirectory, 0755, true);
19
        }
20
21 1697
        parent::__construct($proxiesDirectory);
22 1697
    }
23
}
24