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.

FolderCreator::forPath()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
ccs 3
cts 3
cp 1
cc 3
nc 3
nop 1
crap 3
1
<?php
2
3
4
namespace AloiaCms\Writer;
5
6
class FolderCreator
7
{
8
    /**
9
     * Create a folder for the given path if it doesn't exist
10
     *
11
     * @param string $folder_path
12
     * @throws \Exception
13 66
     */
14
    public static function forPath(string $folder_path): void
15 66
    {
16 65
        if (!file_exists($folder_path)) {
17
            if (!mkdir($folder_path, 0777, true)) {
18 66
                throw new \Exception("Failed to create folder for path {$folder_path}");
19
            }
20
        }
21
    }
22
}
23