Total Complexity | 6 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class LoadedRoute implements JsonSerializable |
||
11 | { |
||
12 | // phpcs:disable |
||
13 | 9 | public function __construct( |
|
18 | 9 | } |
|
19 | |||
20 | // phpcs:enable |
||
21 | |||
22 | /** |
||
23 | * @param array{ |
||
24 | * className: string, |
||
25 | * methodName: string, |
||
26 | * route: array{ |
||
27 | * pattern: string, |
||
28 | * methods: string|list<string>, |
||
29 | * name: null|string, |
||
30 | * middleware: string|list<string>, |
||
31 | * host: null|string, |
||
32 | * schemes: string|list<string>, |
||
33 | * httpPort: null|int, |
||
34 | * httpsPort: null|int, |
||
35 | * options: array<string, mixed> |
||
36 | * } |
||
37 | * } $payload |
||
38 | */ |
||
39 | 3 | public static function fromPayload(array $payload) : self |
|
40 | { |
||
41 | 3 | return new self($payload['className'], $payload['methodName'], Route::fromPayload($payload['route'])); |
|
42 | } |
||
43 | |||
44 | 4 | public function getClassName() : string |
|
45 | { |
||
46 | 4 | return $this->className; |
|
47 | } |
||
48 | |||
49 | 4 | public function getMethodName() : string |
|
52 | } |
||
53 | |||
54 | 4 | public function getRoute() : Route |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return array<string,mixed> |
||
61 | */ |
||
62 | 4 | public function jsonSerialize() : array |
|
71 |