2021-03-24 23:34:46 +08:00
|
|
|
<?php
|
|
|
|
|
|
2022-03-15 18:05:33 +08:00
|
|
|
declare(strict_types=1);
|
2021-03-24 23:34:46 +08:00
|
|
|
|
|
|
|
|
namespace ZM\Annotation\Command;
|
|
|
|
|
|
2022-03-20 01:53:36 +08:00
|
|
|
use Attribute;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
2021-03-24 23:34:46 +08:00
|
|
|
use Doctrine\Common\Annotations\Annotation\Required;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\Target;
|
2021-03-29 15:34:24 +08:00
|
|
|
use ZM\Annotation\AnnotationBase;
|
2021-03-24 23:34:46 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class TerminalCommand
|
|
|
|
|
* @Annotation
|
2022-03-20 01:53:36 +08:00
|
|
|
* @NamedArgumentConstructor
|
2021-03-24 23:34:46 +08:00
|
|
|
* @Target("METHOD")
|
|
|
|
|
*/
|
2022-03-20 01:53:36 +08:00
|
|
|
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)]
|
2021-03-29 15:34:24 +08:00
|
|
|
class TerminalCommand extends AnnotationBase
|
2021-03-24 23:34:46 +08:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
* @Required()
|
|
|
|
|
*/
|
|
|
|
|
public $command;
|
|
|
|
|
|
2021-03-29 15:34:24 +08:00
|
|
|
public $alias = '';
|
|
|
|
|
|
2021-03-24 23:34:46 +08:00
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2022-03-15 18:05:33 +08:00
|
|
|
public $description = '';
|
2022-03-20 01:53:36 +08:00
|
|
|
|
|
|
|
|
public function __construct($command, $alias = '', $description = '')
|
|
|
|
|
{
|
|
|
|
|
$this->command = $command;
|
|
|
|
|
$this->alias = $alias;
|
|
|
|
|
$this->description = $description;
|
|
|
|
|
}
|
2022-03-15 18:05:33 +08:00
|
|
|
}
|