Generator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 17
ccs 0
cts 9
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createDirectory() 0 11 3
1
<?php
2
3
/*
4
 * This file is part of the "RocketORM" package.
5
 *
6
 * https://github.com/RocketORM/ORM
7
 *
8
 * For the full license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Rocket\ORM\Generator;
13
14
/**
15
 * @author Sylvain Lorinet <[email protected]>
16
 */
17
abstract class Generator implements GeneratorInterface
18
{
19
    /**
20
     * @param string $directory
21
     */
22
    protected function createDirectory($directory)
23
    {
24
        if (!is_dir($directory)) {
25
            if (!@mkdir($directory, 755, true)) {
26
                throw new \RuntimeException(
27
                    'The generator "' . end(explode('\\', get_called_class())) . '" cannot create directory "'
0 ignored issues
show
Bug introduced by
explode('\\', get_called_class()) cannot be passed to end() as the parameter $array expects a reference.
Loading history...
28
                    . $directory . '", error message : ' . error_get_last()['message']
29
                );
30
            }
31
        }
32
    }
33
}
34