mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
add PHP8 Attribute compatibility (build 439, 2.7.0-beta4)
This commit is contained in:
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZM\Annotation\Command;
|
||||
|
||||
use Attribute;
|
||||
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
||||
use Doctrine\Common\Annotations\Annotation\Required;
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use ZM\Annotation\AnnotationBase;
|
||||
@@ -11,8 +13,10 @@ use ZM\Annotation\AnnotationBase;
|
||||
/**
|
||||
* Class TerminalCommand
|
||||
* @Annotation
|
||||
* @NamedArgumentConstructor
|
||||
* @Target("METHOD")
|
||||
*/
|
||||
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)]
|
||||
class TerminalCommand extends AnnotationBase
|
||||
{
|
||||
/**
|
||||
@@ -27,4 +31,11 @@ class TerminalCommand extends AnnotationBase
|
||||
* @var string
|
||||
*/
|
||||
public $description = '';
|
||||
|
||||
public function __construct($command, $alias = '', $description = '')
|
||||
{
|
||||
$this->command = $command;
|
||||
$this->alias = $alias;
|
||||
$this->description = $description;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user