| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class LoadedRoute implements JsonSerializable |
||
| 11 | { |
||
| 12 | // phpcs:disable |
||
| 13 | 11 | public function __construct( |
|
| 14 | private string $className, |
||
|
|
|||
| 15 | private string $methodName, |
||
| 16 | private Route $route |
||
| 17 | ) { |
||
| 18 | 11 | } |
|
| 19 | // phpcs:enable |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param array<string,mixed> $payload |
||
| 23 | */ |
||
| 24 | 3 | public static function fromPayload(array $payload): self |
|
| 25 | { |
||
| 26 | 3 | return new self($payload['className'], $payload['methodName'], Route::fromPayload($payload['route'])); |
|
| 27 | } |
||
| 28 | |||
| 29 | 6 | public function getClassName(): string |
|
| 30 | { |
||
| 31 | 6 | return $this->className; |
|
| 32 | } |
||
| 33 | |||
| 34 | 6 | public function getMethodName(): string |
|
| 37 | } |
||
| 38 | |||
| 39 | 6 | public function getRoute(): Route |
|
| 40 | { |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return array<string,mixed> |
||
| 46 | */ |
||
| 47 | 4 | public function jsonSerialize(): array |
|
| 56 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.