2021-03-15 02:54:16 +08:00
|
|
|
<?php
|
|
|
|
|
|
2022-03-15 18:05:33 +08:00
|
|
|
declare(strict_types=1);
|
2021-03-15 02:54:16 +08:00
|
|
|
|
|
|
|
|
namespace ZM\Annotation\Swoole;
|
|
|
|
|
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\Required;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\Target;
|
|
|
|
|
use ZM\Annotation\AnnotationBase;
|
|
|
|
|
use ZM\Annotation\Interfaces\Rule;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class OnTask
|
|
|
|
|
* @Annotation
|
|
|
|
|
* @Target("METHOD")
|
|
|
|
|
*/
|
|
|
|
|
class OnTask extends AnnotationBase implements Rule
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
* @Required()
|
|
|
|
|
*/
|
|
|
|
|
public $task_name;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2022-03-15 18:05:33 +08:00
|
|
|
public $rule = '';
|
2021-03-15 02:54:16 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return mixed
|
|
|
|
|
*/
|
2022-03-15 18:05:33 +08:00
|
|
|
public function getRule(): string
|
|
|
|
|
{
|
2021-03-15 02:54:16 +08:00
|
|
|
return $this->rule;
|
|
|
|
|
}
|
2022-03-15 18:05:33 +08:00
|
|
|
}
|