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;
/**
* 匹配int参数
*/
class IntParameter extends Parameter {
protected static $name = 'int';
public function __construct(string $extra) {
$this->default = intval($this->getCommonDefault($extra));
}
public function unpackValue(string $matched) {
return intval($matched);
* 获取匹配字符串
*
* @return string
public function getMatch():string {
return '(\d+)';