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 (#66)
by
unknown
01:15
created

DefectiveConfiguration::getReason()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 3
nc 3
nop 1
1
<?php
2
3
namespace Spatie\Image\Exceptions;
4
5
use Exception;
6
7
class DefectiveConfiguration extends Exception
8
{
9
    public static function getReason($dirPath)
10
    {
11
        if (! is_dir($dirPath)) {
12
            return 'is not a directory';
13
        }
14
15
        if (! is_writable($dirPath)) {
16
            return 'is not writable';
17
        }
18
19
        return 'it seems to be corrupt';
20
    }
21
22
    public static function invalidTemporaryDirectory($dirPath)
23
    {
24
        $reason = self::getReason($dirPath);
25
26
        return new self("the temporary directory ${dirPath} is not valid as it {$reason} ");
27
    }
28
}
29