Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
RouteNotFoundException
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace Hyde\Framework\Exceptions;
6
7use Exception;
8
9use function sprintf;
10
11class 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}