Completed
Push — master ( fc51f9...b3b654 )
by Freek
03:59
created

InvalidParameter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 17
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 InvalidParameter extends Exception
8
{
9
    public static function directoryDoesNotExist(string $directoryName) : self
10
    {
11
        return new static("Directory `{$directoryName}` does not exist");
12
    }
13
14
    public static function fileDoesNotExist(string $fileName) : self
15
    {
16
        return new static("File `{$fileName}` does not exist");
17
    }
18
19
    public static function directoryIsRequired() : self
20
    {
21
        return new static('A directory must be specified');
22
    }
23
}
24