for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Jerowork\RouteAttributeProvider\RouteLoader;
use Jerowork\RouteAttributeProvider\Api\Route;
use JsonSerializable;
final class LoadedRoute implements JsonSerializable
{
// phpcs:disable
public function __construct(
private string $className,
$className
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
/** @scrutinizer ignore-unused */ private string $className,
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
private string $methodName,
$methodName
/** @scrutinizer ignore-unused */ private string $methodName,
private Route $route
$route
/** @scrutinizer ignore-unused */ private Route $route
) {
}
// phpcs:enable
/**
* @param array<string,mixed> $payload
*/
public static function fromPayload(array $payload): self
return new self($payload['className'], $payload['methodName'], Route::fromPayload($payload['route']));
public function getClassName(): string
return $this->className;
className
Jerowork\RouteAttributeP...RouteLoader\LoadedRoute
public function getMethodName(): string
return $this->methodName;
methodName
public function getRoute(): Route
return $this->route;
route
* @return array<string,mixed>
public function jsonSerialize(): array
return [
'className' => $this->className,
'methodName' => $this->methodName,
'route' => $this->route->jsonSerialize(),
];
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.