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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getReason() 0 12 3
A invalidTemporaryDirectory() 0 6 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