| 1 | <?php |
||
| 28 | class BlockingConsumerData implements PayloadInterface |
||
| 29 | { |
||
| 30 | /** |
||
| 31 | * The TokenBucket. |
||
| 32 | * @var bandwithThottle\tokenBucket\TokenBucket |
||
| 33 | */ |
||
| 34 | protected $bucket; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Initialize $this |
||
| 38 | * @param bandwithThottle\tokenBucket\TokenBucket |
||
| 39 | * @return void |
||
|
|
|||
| 40 | */ |
||
| 41 | public function __construct($bucket) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get the bucket instance. |
||
| 48 | * @return bandwithThottle\tokenBucket\TokenBucket |
||
| 49 | */ |
||
| 50 | public function getBucket() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Implements PayloadInterface |
||
| 57 | * emit json payload. |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function toJson() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Implements PayloadInterface |
||
| 67 | * emit array payload. |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | public function toArray() |
||
| 74 | } |
||
| 75 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.