| 1 | <?php |
||
| 10 | class QueuedMessage implements QueuedMessageInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var AMQPMessage |
||
| 14 | */ |
||
| 15 | private $message; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | private $body; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var AMQPChannel |
||
| 24 | */ |
||
| 25 | private $queueName; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var bool |
||
| 29 | */ |
||
| 30 | private $failed = false; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var Throwable|null |
||
| 34 | */ |
||
| 35 | private $throwable; |
||
| 36 | |||
| 37 | 2 | public function __construct(AMQPMessage $message) |
|
| 43 | |||
| 44 | 1 | public function getQueueName() : string |
|
| 48 | |||
| 49 | 1 | public function getDeliveryTag() : string |
|
| 53 | |||
| 54 | public function fail(Throwable $throwable = null) |
||
| 59 | |||
| 60 | public function isFailed() : bool |
||
| 65 | |||
| 66 | public function getThrowable() |
||
| 70 | |||
| 71 | 2 | public function getBody() : array |
|
| 75 | |||
| 76 | public function getRawBody() : string |
||
| 80 | |||
| 81 | public function setStopWatchEvent(StopwatchEvent $stopwatchEvent) |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @param string $value |
||
| 88 | * |
||
| 89 | * @return mixed|null |
||
| 90 | */ |
||
| 91 | 1 | public function __get(string $value) |
|
| 95 | } |
||
| 96 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: