Test Failed
Push — master ( 4ac6f1...563f56 )
by Andrés
03:26
created

HolidaysPhpException   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 20%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 7
c 1
b 1
f 0
dl 0
loc 30
ccs 2
cts 10
cp 0.2
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A notEmptyCountry() 0 3 1
A unrecognizedStructure() 0 3 1
A notFound() 0 3 1
A notEmptyTitle() 0 3 1
A notEmptyLanguage() 0 3 1
A unsupportedCountry() 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 unrecognizedStructure(): self
30
    {
31
        return new self('The structure of the web page could not be recognized. Maybe it was updated.');
32
    }
33
34
    public static function unsupportedCountry(): self
35
    {
36
        return new self('The specified country is not supported.');
37
    }
38
}
39