mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 23:55:35 +08:00
update some strict parameters and separate easter eggs
This commit is contained in:
@@ -21,10 +21,9 @@ use ZM\Annotation\Interfaces\ErgodicAnnotation;
|
||||
class Controller extends AnnotationBase implements ErgodicAnnotation
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @Required()
|
||||
*/
|
||||
public $prefix = '';
|
||||
public string $prefix = '';
|
||||
|
||||
public function __construct(string $prefix)
|
||||
{
|
||||
|
||||
@@ -20,26 +20,18 @@ use ZM\Annotation\AnnotationBase;
|
||||
class Route extends AnnotationBase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @Required()
|
||||
*/
|
||||
public $route = '';
|
||||
public string $route = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $name = '';
|
||||
public string $name = '';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $request_method = ['GET', 'POST'];
|
||||
public array $request_method = ['GET', 'POST'];
|
||||
|
||||
/**
|
||||
* Routing path params binding. eg. {"id"="\d+"}
|
||||
* @var array
|
||||
*/
|
||||
public $params = [];
|
||||
public array $params = [];
|
||||
|
||||
public function __construct($route, $name = '', $request_method = ['GET', 'POST'], $params = [])
|
||||
{
|
||||
@@ -49,7 +41,7 @@ class Route extends AnnotationBase
|
||||
$this->params = $params;
|
||||
}
|
||||
|
||||
public static function make($route, $name = '', $request_method = ['GET', 'POST'], $params = [])
|
||||
public static function make($route, $name = '', $request_method = ['GET', 'POST'], $params = []): static
|
||||
{
|
||||
return new static($route, $name, $request_method, $params);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user