Completed
Push — master ( 9af8a4...8336df )
by Marco
11s
created

FileNotWritableException::fromNonWritableLocation()   A

Complexity

Conditions 6
Paths 8

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 10
cts 10
cp 1
rs 9.0111
c 0
b 0
f 0
cc 6
nc 8
nop 1
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManager\Exception;
6
7
use UnexpectedValueException;
8
use function sprintf;
9
10
/**
11
 * Exception for non writable files
12
 *
13
 */
14
class FileNotWritableException extends UnexpectedValueException implements ExceptionInterface
15
{
16 1
    public static function fromInvalidMoveOperation(string $fromPath, string $toPath) : self
17
    {
18 1
        return new self(sprintf(
19
            'Could not move file "%s" to location "%s": '
20 1
            . 'either the source file is not readable, or the destination is not writable',
21 1
            $fromPath,
22 1
            $toPath
23
        ));
24
    }
25
}
26