RouteNotFoundException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Framework\Exceptions;
6
7
use Exception;
8
9
use function sprintf;
10
11
class RouteNotFoundException extends Exception
12
{
13
    /** @var string */
14
    protected $message = 'Route not found.';
15
16
    /** @var int */
17
    protected $code = 404;
18
19
    public function __construct(?string $routeKey = null)
20
    {
21
        parent::__construct($routeKey ? sprintf('Route [%s] not found.', $routeKey) : $this->message);
22
    }
23
}
24