-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouteInvalidConfigurationException.php
More file actions
53 lines (45 loc) · 1.12 KB
/
RouteInvalidConfigurationException.php
File metadata and controls
53 lines (45 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
declare(strict_types=1);
/*
* This file is part of the Micro framework package.
*
* (c) Stanislau Komar <kost@micro-php.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Micro\Plugin\Http\Exception;
/**
* @author Stanislau Komar <kost@micro-php.net>
*/
class RouteInvalidConfigurationException extends RouteConfigurationException
{
/**
* @var string[]
*/
private array $messages;
/**
* @param string[] $messages
*/
public function __construct(string $routeName, array $messages, int $code = 0, ?\Throwable $previous = null)
{
$message = <<<EOF
Invalid route "%s" configuration:
* %s
EOF;
$message = sprintf($message, $routeName, implode("\r\n * ", $messages));
$this->messages = $messages;
parent::__construct(
$message,
$code,
$previous
);
}
/**
* @return string[]
*/
public function getMessages(): array
{
return $this->messages;
}
}