| Total Complexity | 5 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 28.57% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Queue { |
||
| 8 | |||
| 9 | /** |
||
| 10 | * @var ConnectionInterface |
||
| 11 | */ |
||
| 12 | protected $connection; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $identifier; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Queue constructor. |
||
| 21 | * |
||
| 22 | * @param ConnectionInterface $connection |
||
| 23 | * @param string $identifier |
||
| 24 | */ |
||
| 25 | 1 | public function __construct( ConnectionInterface $connection, $identifier ) { |
|
| 28 | 1 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * Push a job onto the queue; |
||
| 32 | * |
||
| 33 | * @param Job $job |
||
| 34 | * @param int $delay |
||
| 35 | * |
||
| 36 | * @return bool|int |
||
| 37 | */ |
||
| 38 | public function push( Job $job, $delay = 0 ) { |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Create a cron worker. |
||
| 44 | * |
||
| 45 | * @param int $attempts |
||
| 46 | */ |
||
| 47 | public function cron( $attempts = 3 ) { |
||
| 48 | $cron = new Cron( $this->identifier, $this->worker( $attempts ) ); |
||
| 49 | |||
| 50 | if ( $cron->is_enabled() ) { |
||
| 51 | $cron->init(); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Create a new worker. |
||
| 57 | * |
||
| 58 | * @param int $attempts |
||
| 59 | * |
||
| 60 | * @return Worker |
||
| 61 | */ |
||
| 62 | public function worker( $attempts ) { |
||
| 64 | } |
||
| 65 | } |