mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-20 15:15:35 +08:00
PHP80 小修 (#187)
* migrate-php80 fix styles fix static analyse * fix some bugs
This commit is contained in:
@@ -19,26 +19,18 @@ use ZM\Annotation\AnnotationBase;
|
||||
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)]
|
||||
class Route extends AnnotationBase
|
||||
{
|
||||
/**
|
||||
* @Required()
|
||||
*/
|
||||
public string $route = '';
|
||||
|
||||
public string $name = '';
|
||||
|
||||
public array $request_method = ['GET', 'POST'];
|
||||
|
||||
/**
|
||||
* Routing path params binding. eg. {"id"="\d+"}
|
||||
*/
|
||||
public array $params = [];
|
||||
|
||||
public function __construct($route, $name = '', $request_method = ['GET', 'POST'], $params = [])
|
||||
{
|
||||
$this->route = $route;
|
||||
$this->name = $name;
|
||||
$this->request_method = $request_method;
|
||||
$this->params = $params;
|
||||
public function __construct(
|
||||
/**
|
||||
* @Required()
|
||||
*/
|
||||
public $route,
|
||||
public $name = '',
|
||||
public $request_method = ['GET', 'POST'],
|
||||
/**
|
||||
* Routing path params binding. eg. {"id"="\d+"}
|
||||
*/
|
||||
public $params = []
|
||||
) {
|
||||
}
|
||||
|
||||
public static function make($route, $name = '', $request_method = ['GET', 'POST'], $params = []): static
|
||||
|
||||
Reference in New Issue
Block a user