Completed
Push — master ( 62fddd...a44b62 )
by Tomáš
03:03
created

FilesystemChecker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ensureDirectoryExists() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Symplify
7
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
8
 */
9
10
namespace Symplify\PHP7_Sculpin\Utils;
11
12
use Symplify\PHP7_Sculpin\Exception\Utils\MissingDirectoryException;
13
14
final class FilesystemChecker
15
{
16 5
    public static function ensureDirectoryExists(string $directory)
17
    {
18 5
        if (!is_dir($directory)) {
19 2
            throw new MissingDirectoryException(
20 2
                sprintf('Directory "%s" was not found.', $directory)
21
            );
22
        }
23 3
    }
24
}
25