InvalidPointerException::nonexistentValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 4
Code Lines 2

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
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 6
    public static function nonexistentValue($value)
23
    {
24 6
        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