改名
This commit is contained in:
@@ -39,6 +39,7 @@ class Node extends Application
|
||||
public $callback = [];
|
||||
|
||||
private $_interceptors = [];
|
||||
private $_limits = [];
|
||||
|
||||
/**
|
||||
* @param $handler
|
||||
@@ -73,6 +74,15 @@ class Node extends Application
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasLimits()
|
||||
{
|
||||
return count($this->_limits) > 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -81,6 +91,16 @@ class Node extends Application
|
||||
return $this->_interceptors;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getLimits()
|
||||
{
|
||||
return $this->_limits;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $request
|
||||
* @return bool
|
||||
@@ -174,6 +194,17 @@ class Node extends Application
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Closure|array|string $handler
|
||||
* @throws Exception
|
||||
*/
|
||||
public function addLimits($handler)
|
||||
{
|
||||
$this->_limits[] = $handler;
|
||||
$this->restructure();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* 错误信息
|
||||
|
||||
Reference in New Issue
Block a user