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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 21
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A doCreate() 0 5 3
A isCorrectType() 0 3 1
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