@@ -140,6 +140,9 @@ |
||
| 140 | 140 | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | + /** |
|
| 144 | + * @param string $name |
|
| 145 | + */ |
|
| 143 | 146 | public function getInstance($name, TaskParameters $parameters = null) { |
| 144 | 147 | |
| 145 | 148 | $task_class = $this->getClass(); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * Set queue item's id |
| 52 | 52 | * |
| 53 | 53 | * @param string $id |
| 54 | - * @return Schedule |
|
| 54 | + * @return BaseEntityTrait |
|
| 55 | 55 | */ |
| 56 | 56 | public function setId($id) { |
| 57 | 57 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * Set queue item's name |
| 77 | 77 | * |
| 78 | 78 | * @param string $name |
| 79 | - * @return Schedule |
|
| 79 | + * @return BaseEntityTrait |
|
| 80 | 80 | */ |
| 81 | 81 | public function setName($name) { |
| 82 | 82 | |
@@ -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 BaseScheduleEntityTrait |
|
| 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 BaseScheduleEntityTrait |
|
| 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 BaseScheduleEntityTrait |
|
| 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 BaseScheduleEntityTrait |
|
| 144 | 144 | */ |
| 145 | 145 | public function setParameters(TaskParameters $parameters) { |
| 146 | 146 | |
@@ -39,8 +39,7 @@ |
||
| 39 | 39 | /** |
| 40 | 40 | * Set EntityManager |
| 41 | 41 | * |
| 42 | - * @param string $id |
|
| 43 | - * @return Schedule |
|
| 42 | + * @return EntityManagerTrait |
|
| 44 | 43 | */ |
| 45 | 44 | public function setEntityManager(EntityManager $em) { |
| 46 | 45 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $thetask = $this->table->get($task)->getInstance($name, $parameters); |
| 99 | 99 | |
| 100 | - $this->events->emit( new TaskEvent('start', $thetask) ); |
|
| 100 | + $this->events->emit(new TaskEvent('start', $thetask)); |
|
| 101 | 101 | |
| 102 | 102 | $pid = $thetask->getPid(); |
| 103 | 103 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->stopwatch->getStartTime() |
| 113 | 113 | ); |
| 114 | 114 | |
| 115 | - $this->events->emit( new TaskStatusEvent('start', $thetask) ); |
|
| 115 | + $this->events->emit(new TaskStatusEvent('start', $thetask)); |
|
| 116 | 116 | |
| 117 | 117 | try { |
| 118 | 118 | |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $this->events->emit( new TaskStatusEvent($status ? 'success' : 'error', $thetask) ); |
|
| 137 | + $this->events->emit(new TaskStatusEvent($status ? 'success' : 'error', $thetask)); |
|
| 138 | 138 | |
| 139 | - $this->events->emit( new TaskStatusEvent('stop', $thetask) ); |
|
| 139 | + $this->events->emit(new TaskStatusEvent('stop', $thetask)); |
|
| 140 | 140 | |
| 141 | - $this->events->emit( new TaskEvent('stop', $thetask) ); |
|
| 141 | + $this->events->emit(new TaskEvent('stop', $thetask)); |
|
| 142 | 142 | |
| 143 | 143 | $this->stopwatch->stop(); |
| 144 | 144 | |
@@ -190,6 +190,15 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | + /** |
|
| 194 | + * @param integer $uid |
|
| 195 | + * @param integer $puid |
|
| 196 | + * @param string $name |
|
| 197 | + * @param integer $jid |
|
| 198 | + * @param string $task |
|
| 199 | + * @param TaskParameters $parameters |
|
| 200 | + * @param \DateTime $start |
|
| 201 | + */ |
|
| 193 | 202 | protected function openWorklog( |
| 194 | 203 | $uid, |
| 195 | 204 | $puid, |
@@ -221,6 +230,9 @@ discard block |
||
| 221 | 230 | |
| 222 | 231 | } |
| 223 | 232 | |
| 233 | + /** |
|
| 234 | + * @param \DateTime $end |
|
| 235 | + */ |
|
| 224 | 236 | protected function closeWorklog( |
| 225 | 237 | $status, |
| 226 | 238 | $result, |
@@ -356,7 +356,7 @@ |
||
| 356 | 356 | |
| 357 | 357 | public function isChain() { |
| 358 | 358 | |
| 359 | - return ( $this->done !== null || $this->fail !== null || $this->pipe !== null ); |
|
| 359 | + return ($this->done !== null || $this->fail !== null || $this->pipe !== null); |
|
| 360 | 360 | |
| 361 | 361 | } |
| 362 | 362 | |
@@ -116,6 +116,9 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | + /** |
|
| 120 | + * @param string $name |
|
| 121 | + */ |
|
| 119 | 122 | public function setName($name) { |
| 120 | 123 | |
| 121 | 124 | $this->name = $name; |
@@ -135,6 +138,9 @@ discard block |
||
| 135 | 138 | |
| 136 | 139 | } |
| 137 | 140 | |
| 141 | + /** |
|
| 142 | + * @param string $task |
|
| 143 | + */ |
|
| 138 | 144 | public function setTask($task) { |
| 139 | 145 | |
| 140 | 146 | $this->task = $task; |
@@ -260,7 +266,7 @@ discard block |
||
| 260 | 266 | /** |
| 261 | 267 | * Get start timestamp (microseconds) |
| 262 | 268 | * |
| 263 | - * @return float |
|
| 269 | + * @return integer |
|
| 264 | 270 | */ |
| 265 | 271 | public function getStartTimestamp() { |
| 266 | 272 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | $client = \Comodojo\Daemon\Socket\Client::create('unix://extender.sock'); |
| 8 | 8 | |
| 9 | - $data = $client->send('scheduler:refresh',[]); |
|
| 9 | + $data = $client->send('scheduler:refresh', []); |
|
| 10 | 10 | |
| 11 | 11 | } catch (Exception $e) { |
| 12 | 12 | |
@@ -48,6 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | + /** |
|
| 52 | + * @param integer $uid |
|
| 53 | + */ |
|
| 51 | 54 | public function init($uid) { |
| 52 | 55 | |
| 53 | 56 | $this->ipc[$uid] = []; |
@@ -72,6 +75,10 @@ discard block |
||
| 72 | 75 | |
| 73 | 76 | } |
| 74 | 77 | |
| 78 | + /** |
|
| 79 | + * @param integer $uid |
|
| 80 | + * @param string $data |
|
| 81 | + */ |
|
| 75 | 82 | public function write($uid, $data) { |
| 76 | 83 | |
| 77 | 84 | $writer = $this->ipc[$uid][self::WRITER]; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | /** |
| 137 | 137 | * Get cron expression of this schedule |
| 138 | 138 | * |
| 139 | - * @return string |
|
| 139 | + * @return CronExpression |
|
| 140 | 140 | */ |
| 141 | 141 | public function getExpression() { |
| 142 | 142 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | /** |
| 148 | 148 | * set cron expression for this schedule |
| 149 | 149 | * |
| 150 | - * @param srting $expression A cron-compatible expression |
|
| 150 | + * @param CronExpression $expression A cron-compatible expression |
|
| 151 | 151 | * @return Schedule |
| 152 | 152 | */ |
| 153 | 153 | public function setExpression(CronExpression $expression) { |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | /** |
| 178 | 178 | * Set enable/disable status |
| 179 | 179 | * |
| 180 | - * @param bool $enable |
|
| 180 | + * @param boolean $enabled |
|
| 181 | 181 | * @return Schedule |
| 182 | 182 | */ |
| 183 | 183 | public function setEnabled($enabled) { |