Completed
Pull Request — master (#14)
by
unknown
06:16
created

InvalidPointerException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 32
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 nonexistentValue() 0 4 1
A invalidTarget() 0 4 1
1
<?php
2
3
namespace Activerules\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