for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bavix\Router;
use Bavix\Router\Rules\PatternRule;
class Route implements \Serializable
{
/**
* @var PatternRule
*/
protected $rule;
* @return array
public function getDefaults(): array
return $this->rule->getDefaults();
}
public function getAttributes(): array
return $this->attributes ?? $this->getDefaults();
attributes
Bavix\Router\Route
* @param string $method
*
* @return bool
protected function methodAllowed(string $method): bool
$methods = $this->rule->getMethods();
return $methods === null || \in_array($method, $methods, true);
* @param string $uri
* @return Match
protected function match(string $uri): Match
return new Match($this->rule, $uri);
public function test(string $uri, string $method): bool
return $this->methodAllowed($method) && $this->match($uri)->isTest();
* @inheritdoc
public function serialize(): string
public function unserialize($serialized): void