Completed
Push — master ( 6e54fa...ff2314 )
by David
12s
created

IoException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A cannotCreateDirectory() 0 6 1
A cannotWriteFile() 0 5 1
1
<?php
2
3
4
namespace TheCodingMachine\Funky;
5
6
class IoException extends \RuntimeException
7
{
8
    public static function cannotWriteFile(string $fileName): self
9
    {
10
        return new self(sprintf(
11
            'Failed to write file %s',
12
            $fileName
13
        ));
14
    }
15
16
    public static function cannotCreateDirectory(string $dirName, string $message): self
17
    {
18
        return new self(sprintf(
19
            'Failed to create directory %s: %s',
20
            $dirName,
21
            $message
22
        ));
23
    }
24
}
25