for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace nebula\route\uri\parameter;
use nebula\route\uri\parameter\Parameter;
/**
* 匹配 string 参数
*/
class StringParameter extends Parameter {
protected static $name = 'string';
public function __construct(string $extra) {
$this->default = $this->getCommonDefault($extra);
}
public function unpackValue(string $matched) {
return urldecode($matched);
public function packValue(string $matched) {
return urlencode($matched);
* 获取匹配字符串
*
* @return string
public function getMatch():string {
return '([^\/]+)';