Completed
Push — master ( bc6486...205307 )
by Matt
02:03
created

InvalidPointerException::invalidFirstCharacter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace League\JsonReference\Pointer;
4
5
final class InvalidPointerException extends \InvalidArgumentException
6
{
7
    /**
8
     * @param string $type
9
     *
10
     * @return static
11
     */
12 2
    public static function invalidType($type)
13
    {
14 2
        return new static(sprintf('Only strings are valid pointers, got "%s"', $type));
15
    }
16
17
    /**
18
     * @param string $value
19
     *
20
     * @return static
21
     */
22 12
    public static function nonexistentValue($value)
23
    {
24 12
        return new static(sprintf('The pointer referenced a value that does not exist.  The value was: "%s"', $value));
25
    }
26
27
    /**
28
     * @param string $target
29
     *
30
     * @return static
31
     */
32 2
    public static function invalidTarget($target)
33
    {
34 2
        return new static(sprintf('Cannot set the value for %s because it is not within object or array', $target));
35
    }
36
}
37