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

InvalidFeedException::undefinedVersionException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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