Completed
Push — master ( 30f4d3...51e609 )
by Jérémy
02:05
created

InvalidFeedException   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 45
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidFeedProperty() 0 4 1
A invalidItemProperty() 0 4 1
A invalidAuthorProperty() 0 4 1
A invalidJsonException() 0 4 1
A undefinedVersionException() 0 4 1
1
<?php
2
3
namespace JDecool\JsonFeed\Exceptions;
4
5
use Exception;
6
7
class InvalidFeedException extends Exception
8
{
9
    /**
10
     * @return InvalidFeedException
11
     */
12
    public static function invalidJsonException()
13
    {
14
        return new self('Invalid JSONFeed string');
15
    }
16
17
    /**
18
     * @return InvalidFeedException
19
     */
20
    public static function undefinedVersionException()
21
    {
22
        return new self('Undefined JSONFeed version');
23
    }
24
25
    /**
26
     * @param string $property
27
     * @return InvalidFeedException
28
     */
29
    public static function invalidFeedProperty($property)
30
    {
31
        return new self(sprintf('Invalid feed property "%s"', $property));
32
    }
33
34
    /**
35
     * @param string $property
36
     * @return InvalidFeedException
37
     */
38
    public static function invalidItemProperty($property)
39
    {
40
        return new self(sprintf('Invalid item property "%s"', $property));
41
    }
42
43
    /**
44
     * @param string $property
45
     * @return InvalidFeedException
46
     */
47
    public static function invalidAuthorProperty($property)
48
    {
49
        return new self(sprintf('Invalid author property "%s"', $property));
50
    }
51
}
52