for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace nebula\route;
use Serializable;
use nebula\route\uri\UriMatcher;
/**
* 路由匹配器
*
*/
class RouteMatcher
{
* 匹配的方法
* @var array
protected $methods;
* 匹配的URI
* @var string
protected $uri;
* 属性
protected $attribute;
* Uri匹配器
* @var UriMatcher
protected $matcher;
public function __construct(array $methods, string $uri, array $attribute=[])
array_walk($methods, function ($value) {
return strtoupper($value);
});
$this->methods = $methods;
$this->uri = $uri;
$this->matcher = UriMatcher::build($uri);
$this->attribute = $attribute;
}
* Get 属性
* @return array
public function getAttribute()
return $this->attribute;
* Set 属性
* @param array $attribute 属性
* @return self
public function setAttribute(array $attribute)
return $this;
* Get 匹配的方法
* @return string
public function getMethods()
return $this->methods;
return $this->methods
array
string
* Set 匹配的方法
* @param string $methods 匹配的方法
public function setMethods(string $methods)
$methods
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
* Get 匹配的URI
public function getUri()
return $this->uri;
* Set 匹配的URI
* @param string $uri 匹配的URI
public function setUri(string $uri)
* Get uri匹配器
* @return UriMatcher
public function getMatcher()
return $this->matcher;