| 1 | <?php |
||
| 7 | class Task implements Message |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | private $name; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | private $body; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var int |
||
| 21 | */ |
||
| 22 | private $delay; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Task constructor. |
||
| 26 | * @param string $name |
||
| 27 | * @param array $body |
||
| 28 | * @param int $delay |
||
| 29 | */ |
||
| 30 | public function __construct($name, array $body, $delay=0) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | public function getName() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | public function getBody() |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return int |
||
| 55 | */ |
||
| 56 | public function getDelay() |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return array |
||
| 63 | */ |
||
| 64 | public function jsonSerialize() |
||
| 72 | } |