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

InvalidPointerException::invalidFirstCharacter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
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