DotPathException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 17
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
3
namespace VGirol\JsonApiStructure\Exception;
4
5
use Throwable;
6
7
/**
8
 * Exception for dot notation
9
 */
10
class DotPathException extends \Exception
11
{
12
    public const DOT_PATH_ERROR = 'Path "%s" is not valid : segment "%s" does not exists.';
13
14
    /**
15
     * Class constructor
16
     *
17
     * @param string $path
18
     * @param string $segment
19
     * @param integer $code
20
     * @param Throwable|null $previous
21
     *
22
     * @return void
23
     */
24 3
    public function __construct(string $path, string $segment, $code = 0, ?Throwable $previous = null)
25
    {
26 3
        parent::__construct(sprintf(self::DOT_PATH_ERROR, $path, $segment), $code, $previous);
27 3
    }
28
}
29