| 1 | <?php |
||
| 10 | class Options |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * The number of seconds before a released job will be available. |
||
| 14 | * |
||
| 15 | * @var int |
||
| 16 | */ |
||
| 17 | public $delay; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * The maximum amount of RAM the worker may consume. |
||
| 21 | * |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | public $memory; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * The maximum number of seconds a child worker may run. |
||
| 28 | * |
||
| 29 | * @var int |
||
| 30 | */ |
||
| 31 | public $timeout; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * The number of seconds to wait in between polling the queue. |
||
| 35 | * |
||
| 36 | * @var int |
||
| 37 | */ |
||
| 38 | public $sleep; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * The maximum amount of times a job may be attempted. |
||
| 42 | * |
||
| 43 | * @var int |
||
| 44 | */ |
||
| 45 | public $maxTries; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Indicates if the worker should run in maintenance mode. |
||
| 49 | * |
||
| 50 | * @var bool |
||
| 51 | */ |
||
| 52 | public $force; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * WorkerOptions constructor. |
||
| 56 | * |
||
| 57 | * @param int $delay |
||
| 58 | * @param int $memory |
||
| 59 | * @param int $timeout |
||
| 60 | * @param int $sleep |
||
| 61 | * @param int $maxTries |
||
| 62 | * @param bool $force |
||
| 63 | */ |
||
| 64 | public function __construct( |
||
| 79 | |||
| 80 | public function getBinaryArgs(): string |
||
| 84 | |||
| 85 | public function getBinPath() |
||
| 89 | |||
| 90 | public function getScriptName(): string |
||
| 94 | |||
| 95 | /** |
||
| 96 | * Get the escaped PHP Binary from the configuration |
||
| 97 | * |
||
| 98 | * @return string |
||
| 99 | */ |
||
| 100 | public function getPhpBinary(): string |
||
| 114 | } |
||
| 115 |
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: