FileAccessException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A writeFileException() 0 3 1
A readFileException() 0 3 1
1
<?php
2
3
/**
4
 * Static Analysis Results Baseliner (sarb).
5
 *
6
 * (c) Dave Liddament
7
 *
8
 * For the full copyright and licence information please view the LICENSE file distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Domain\File;
14
15
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\FileName;
16
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\SarbException;
17
18
final class FileAccessException extends SarbException
19
{
20
    public static function readFileException(FileName $fileName): self
21
    {
22
        return new self("Failed to read file [{$fileName->getFileName()}] (does it exist with correct permissions?)");
23
    }
24
25
    public static function writeFileException(FileName $fileName): self
26
    {
27
        return new self("Failed to write file [{$fileName->getFileName()}] (are permissions correct?)");
28
    }
29
}
30