for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace PTS\PSR15Routing;
use Psr\Http\Server\RequestHandlerInterface;
class Route
{
/** @var string */
protected $path;
/** @var RequestHandlerInterface */
protected $handler;
/** @var array */
protected $matches = [];
protected $methods = [];
protected $restrictions = [];
public function __construct(string $path, RequestHandlerInterface $handler)
$this->path = $path;
$this->handler = $handler;
}
public function setMatches(array $values = []): self
$this->matches = $values;
return $this;
public function getMatchesParams(): array
return $this->matches;
public function getMethods(): array
return $this->methods;
public function setMethods(array $methods): self
$this->methods = $methods;
public function setRestrictions(array $restrictions): self
$this->restrictions = $restrictions;
public function getRestrictions(): array
return $this->restrictions;
public function getHandler(): RequestHandlerInterface
return $this->handler;
public function getPath(): string
return $this->path;