@@ -28,6 +28,9 @@ |
||
| 28 | 28 | |
| 29 | 29 | private $task; |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param string $status |
|
| 33 | + */ |
|
| 31 | 34 | public function __construct($status, TaskInterface $task) { |
| 32 | 35 | |
| 33 | 36 | $name = $task->getName(); |
@@ -149,7 +149,6 @@ |
||
| 149 | 149 | /** |
| 150 | 150 | * Set current job status |
| 151 | 151 | * |
| 152 | - * @param string $name |
|
| 153 | 152 | * @return Worklog |
| 154 | 153 | */ |
| 155 | 154 | public function setStatus($status) { |
@@ -67,8 +67,7 @@ discard block |
||
| 67 | 67 | /** |
| 68 | 68 | * Get niceness of a running process |
| 69 | 69 | * |
| 70 | - * @param int|null $pid The pid to query, or current process if null |
|
| 71 | - * @return int |
|
| 70 | + * @return string |
|
| 72 | 71 | */ |
| 73 | 72 | public function getName() { |
| 74 | 73 | |
@@ -79,8 +78,7 @@ discard block |
||
| 79 | 78 | /** |
| 80 | 79 | * Get niceness of a running process |
| 81 | 80 | * |
| 82 | - * @param int|null $pid The pid to query, or current process if null |
|
| 83 | - * @return int |
|
| 81 | + * @return TaskParameters |
|
| 84 | 82 | */ |
| 85 | 83 | public function getParameters() { |
| 86 | 84 | |
@@ -91,8 +89,8 @@ discard block |
||
| 91 | 89 | /** |
| 92 | 90 | * Get niceness of a running process |
| 93 | 91 | * |
| 94 | - * @param int|null $pid The pid to query, or current process if null |
|
| 95 | - * @return int |
|
| 92 | + * @param string $name |
|
| 93 | + * @return AbstractTask |
|
| 96 | 94 | */ |
| 97 | 95 | public function setName($name) { |
| 98 | 96 | |
@@ -105,8 +103,7 @@ discard block |
||
| 105 | 103 | /** |
| 106 | 104 | * Get niceness of a running process |
| 107 | 105 | * |
| 108 | - * @param int|null $pid The pid to query, or current process if null |
|
| 109 | - * @return int |
|
| 106 | + * @return AbstractTask |
|
| 110 | 107 | */ |
| 111 | 108 | public function setParameters(TaskParameters $parameters) { |
| 112 | 109 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * Set queue item's id |
| 66 | 66 | * |
| 67 | 67 | * @param string $id |
| 68 | - * @return Schedule |
|
| 68 | + * @return BaseEntityTrait |
|
| 69 | 69 | */ |
| 70 | 70 | public function setId($id) { |
| 71 | 71 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * Set queue item's name |
| 91 | 91 | * |
| 92 | 92 | * @param string $name |
| 93 | - * @return Schedule |
|
| 93 | + * @return BaseEntityTrait |
|
| 94 | 94 | */ |
| 95 | 95 | public function setName($name) { |
| 96 | 96 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * Set associated task |
| 116 | 116 | * |
| 117 | 117 | * @param string $task |
| 118 | - * @return Schedule |
|
| 118 | + * @return BaseEntityTrait |
|
| 119 | 119 | */ |
| 120 | 120 | public function setTask($task) { |
| 121 | 121 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * Set queue item's parameters |
| 141 | 141 | * |
| 142 | 142 | * @param TaskParameters $parameters |
| 143 | - * @return Schedule |
|
| 143 | + * @return BaseEntityTrait |
|
| 144 | 144 | */ |
| 145 | 145 | public function setParameters(TaskParameters $parameters) { |
| 146 | 146 | |
@@ -137,7 +137,7 @@ |
||
| 137 | 137 | |
| 138 | 138 | $result = []; |
| 139 | 139 | |
| 140 | - foreach($tasks as $task) { |
|
| 140 | + foreach ( $tasks as $task ) { |
|
| 141 | 141 | |
| 142 | 142 | if ( empty($task['name']) || empty($task['class']) ) { |
| 143 | 143 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $thetask = $this->table->get($task)->getInstance($name, $parameters); |
| 90 | 90 | |
| 91 | - $this->events->emit( new TaskEvent('start', $thetask) ); |
|
| 91 | + $this->events->emit(new TaskEvent('start', $thetask)); |
|
| 92 | 92 | |
| 93 | 93 | $pid = $thetask->getPid(); |
| 94 | 94 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $this->stopwatch->getStartTime() |
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | - $this->events->emit( new TaskStatusEvent('start', $thetask) ); |
|
| 104 | + $this->events->emit(new TaskStatusEvent('start', $thetask)); |
|
| 105 | 105 | |
| 106 | 106 | try { |
| 107 | 107 | |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - $this->events->emit( new TaskStatusEvent($status ? 'success' : 'error', $thetask) ); |
|
| 126 | + $this->events->emit(new TaskStatusEvent($status ? 'success' : 'error', $thetask)); |
|
| 127 | 127 | |
| 128 | - $this->events->emit( new TaskStatusEvent('stop', $thetask) ); |
|
| 128 | + $this->events->emit(new TaskStatusEvent('stop', $thetask)); |
|
| 129 | 129 | |
| 130 | - $this->events->emit( new TaskEvent('stop', $thetask) ); |
|
| 130 | + $this->events->emit(new TaskEvent('stop', $thetask)); |
|
| 131 | 131 | |
| 132 | 132 | $this->stopwatch->stop(); |
| 133 | 133 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | return new Result( |
| 147 | - array ( |
|
| 147 | + array( |
|
| 148 | 148 | $pid, |
| 149 | 149 | $name, |
| 150 | 150 | $status, |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | |
| 22 | -class Result extends Model{ |
|
| 22 | +class Result extends Model { |
|
| 23 | 23 | |
| 24 | 24 | protected $mode = self::READONLY; |
| 25 | 25 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | |
| 22 | -class Result extends Model{ |
|
| 22 | +class Result extends Model { |
|
| 23 | 23 | |
| 24 | 24 | protected $mode = self::READONLY; |
| 25 | 25 | |
@@ -111,9 +111,9 @@ |
||
| 111 | 111 | |
| 112 | 112 | $t = microtime(true); |
| 113 | 113 | |
| 114 | - $micro = sprintf("%06d",($t - floor($t)) * 1000000); |
|
| 114 | + $micro = sprintf("%06d", ($t - floor($t)) * 1000000); |
|
| 115 | 115 | |
| 116 | - return new DateTime( date('Y-m-d H:i:s.'.$micro, $t) ); |
|
| 116 | + return new DateTime(date('Y-m-d H:i:s.'.$micro, $t)); |
|
| 117 | 117 | |
| 118 | 118 | } |
| 119 | 119 | |