Passed
Push — master ( 79b3fb...96316b )
by Andrés
02:29
created

HolidaysPhpException   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 14.29%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 8
c 1
b 1
f 0
dl 0
loc 35
ccs 2
cts 14
cp 0.1429
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A notEmptyCountry() 0 3 1
A notFound() 0 3 1
A notEmptyTitle() 0 3 1
A notEmptyLanguage() 0 3 1
A unrecognizedStructure() 0 3 1
A unsupportedCountry() 0 3 1
A unrecognizedDate() 0 3 1
1
<?php
2
3
namespace Andreshg112\HolidaysPhp;
4
5
use Exception;
6
7
class HolidaysPhpException extends Exception
8
{
9
    public static function notEmptyCountry(): self
10
    {
11
        return new self('The country must not be empty.');
12
    }
13
14
    public static function notEmptyLanguage(): self
15
    {
16
        return new self('The language must not be empty.');
17
    }
18
19
    public static function notEmptyTitle(): self
20
    {
21
        return new self('The title must not be empty.');
22
    }
23
24 1
    public static function notFound(): self
25
    {
26 1
        return new self('The requested web page could not be found.');
27
    }
28
29
    public static function unrecognizedDate(): self
30
    {
31
        return new self('The date of a holiday could not be recognized. Maybe the structure was updated.');
32
    }
33
34
    public static function unrecognizedStructure(): self
35
    {
36
        return new self('The structure of the web page could not be recognized. Maybe it was updated.');
37
    }
38
39
    public static function unsupportedCountry(): self
40
    {
41
        return new self('The specified country is not supported.');
42
    }
43
}
44