GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#154)
by Ross
22:04
created

Directory::doCreate()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 2
nc 2
nop 0
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem;
4
5
class Directory extends AbstractFilesystemItem
6
{
7
    /**
8
     * This is the name of the path type. It should be overriden in child classes.
9
     *
10
     * @var string
11
     */
12
    protected const PATH_TYPE = 'directory';
13
14 4
    protected function doCreate(): void
15
    {
16 4
        if (!mkdir($this->path, $this->createModeOctal, true) && !is_dir($this->path)) {
17
            // @codeCoverageIgnoreStart
18
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $this->path));
19
            // @codeCoverageIgnoreEnd
20
        }
21 4
    }
22
23 6
    protected function isCorrectType(): bool
24
    {
25 6
        return $this->createSplFileInfo()->isDir();
26
    }
27
}
28