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

InvalidArgument::directoryIsRequired()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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