Passed
Branch new-version (f6fba9)
by Jeroen
02:15
created

VCardException::forUnreadableFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace JeroenDesloovere\VCard\Exception;
4
5
class VCardException extends \Exception
6
{
7
    public static function forUnreadableFile(string $file): self
8
    {
9
        return new self(
10
            sprintf("File %s is not readable, or doesn't exist.", $file)
11
        );
12
    }
13
14
    public static function forWrongValue(string $value, array $possibleValues): self
15
    {
16
        return new self(
17
            'The given type "' . $value . '" is not allowed. Possible values are: ' . implode(', ', $possibleValues)
18
        );
19
    }
20
}
21