Completed
Push — master ( 5927eb...1e13db )
by
unknown
04:04
created

InvalidPointerException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%
Metric Value
dl 0
loc 29
ccs 6
cts 6
cp 1
rs 10
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidType() 0 4 1
A invalidFirstCharacter() 0 4 1
A nonexistentValue() 0 4 1
1
<?php
2
3
namespace League\JsonGuard\Pointer;
4
5
class InvalidPointerException extends \InvalidArgumentException
6
{
7
    /**
8
     * @param string $type
9
     * @return static
10
     */
11 2
    public static function invalidType($type)
12
    {
13 2
        return new static(sprintf('Only strings are valid pointers, got "%s"', $type));
14
    }
15
16
    /**
17
     * @param string $character
18
     * @return static
19
     */
20 2
    public static function invalidFirstCharacter($character)
21
    {
22 2
        return new static(sprintf('A pointer must start with "/", got "%s"', $character));
23
    }
24
25
    /**
26
     * @param string $value
27
     * @return static
28
     */
29 2
    public static function nonexistentValue($value)
30
    {
31 2
        return new static(sprintf('The pointer referenced a value that does not exist.  The value was: "%s"', $value));
32
    }
33
}
34