Completed
Pull Request — master (#1893)
by Andreas
21:22
created

FileLocator::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
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
    public function __construct(string $proxiesDirectory)
14
    {
15
        $absolutePath = realpath($proxiesDirectory);
16
17
        if ($absolutePath === false) {
18
            mkdir($proxiesDirectory, 0755, true);
19
        }
20
21
        parent::__construct($proxiesDirectory);
22
    }
23
}
24