Completed
Push — master ( 15ce78...c333c0 )
by Freek
02:35
created

InvalidArgument   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A directoryDoesNotExist() 0 4 1
A fileDoesNotExist() 0 4 1
A directoryIsRequired() 0 4 1
1
<?php
2
3
namespace Spatie\Php7to5\Exceptions;
4
5
use Exception;
6
7
class InvalidArgument extends Exception
8
{
9
    /**
10
     * @param string $directoryName
11
     *
12
     * @return \Spatie\Php7to5\Exceptions\InvalidArgument
13
     */
14
    public static function directoryDoesNotExist($directoryName)
15
    {
16
        return new static("Directory `{$directoryName}` does not exist");
17
    }
18
19
    /**
20
     * @param string $fileName
21
     *
22
     * @return \Spatie\Php7to5\Exceptions\InvalidArgument
23
     */
24
    public static function fileDoesNotExist($fileName)
25
    {
26
        return new static("File `{$fileName}` does not exist");
27
    }
28
29
    /**
30
     * @return \Spatie\Php7to5\Exceptions\InvalidArgument
31
     */
32
    public static function directoryIsRequired()
33
    {
34
        return new static('A directory must be specified');
35
    }
36
}
37