Completed
Push — master ( 6f39c4...0208de )
by Vincent
02:02 queued 11s
created

DotPathException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 4
dl 0
loc 3
rs 10
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
    public function __construct(string $path, string $segment, $code = 0, ?Throwable $previous = null)
25
    {
26
        parent::__construct(sprintf(self::DOT_PATH_ERROR, $path, $segment), $code, $previous);
27
    }
28
}
29