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

IoException::cannotWriteFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
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