@@ -33,6 +33,9 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | protected $viewCheck; |
| 35 | 35 | |
| 36 | + /** |
|
| 37 | + * @param Closure $check |
|
| 38 | + */ |
|
| 36 | 39 | public function __construct($action = 'execute', $check = null) { |
| 37 | 40 | $this->action = $action; |
| 38 | 41 | if (!$check) { |
@@ -85,7 +88,7 @@ discard block |
||
| 85 | 88 | * Which columns are handled by this component |
| 86 | 89 | * |
| 87 | 90 | * @param type $gridField |
| 88 | - * @return type |
|
| 91 | + * @return string[] |
|
| 89 | 92 | */ |
| 90 | 93 | public function getColumnsHandled($gridField) { |
| 91 | 94 | return array('Actions'); |
@@ -95,7 +98,7 @@ discard block |
||
| 95 | 98 | * Which GridField actions are this component handling |
| 96 | 99 | * |
| 97 | 100 | * @param GridField $gridField |
| 98 | - * @return array |
|
| 101 | + * @return string[] |
|
| 99 | 102 | */ |
| 100 | 103 | public function getActions($gridField) { |
| 101 | 104 | return array('execute', 'pause', 'resume'); |
@@ -11,6 +11,9 @@ |
||
| 11 | 11 | $job->activateOnQueue(); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param Date $date |
|
| 16 | + */ |
|
| 14 | 17 | public function scheduleJob(QueuedJobDescriptor $job, $date) { |
| 15 | 18 | // noop |
| 16 | 19 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | /** |
| 38 | 38 | * Logs the status of the queued job descriptor. |
| 39 | 39 | * |
| 40 | - * @param bool|null|QueuedJobDescriptor $descriptor |
|
| 40 | + * @param DataObject|null $descriptor |
|
| 41 | 41 | * @param string $queue |
| 42 | 42 | */ |
| 43 | 43 | protected function logDescriptorStatus($descriptor, $queue) { |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * @return array List of rules |
|
| 25 | + * @return string List of rules |
|
| 26 | 26 | */ |
| 27 | 27 | public function getDefaultRules() { |
| 28 | 28 | return $this->defaultRules; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * @param string $queue |
| 69 | - * @return null|QueuedJobDescriptor |
|
| 69 | + * @return DataObject|null |
|
| 70 | 70 | */ |
| 71 | 71 | protected function getNextJobDescriptorWithoutMutex($queue) { |
| 72 | 72 | $list = QueuedJobDescriptor::get() |
@@ -1,7 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use AsyncPHP\Doorman\Rule; |
|
| 4 | - |
|
| 5 | 3 | /** |
| 6 | 4 | * Runs all jobs through the doorman engine |
| 7 | 5 | */ |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * Start a job (or however the queue handler determines it should be started) |
| 164 | 164 | * |
| 165 | - * @param JobDescriptor $jobDescriptor |
|
| 165 | + * @param QueuedJobDescriptor $jobDescriptor |
|
| 166 | 166 | * @param date $startAfter |
| 167 | 167 | */ |
| 168 | 168 | public function startJob($jobDescriptor, $startAfter = null) { |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * Copies data from a job into a descriptor for persisting |
| 179 | 179 | * |
| 180 | 180 | * @param QueuedJob $job |
| 181 | - * @param JobDescriptor $jobDescriptor |
|
| 181 | + * @param DataObject $jobDescriptor |
|
| 182 | 182 | */ |
| 183 | 183 | protected function copyJobToDescriptor($job, $jobDescriptor) { |
| 184 | 184 | $data = $job->getJobData(); |
@@ -322,6 +322,7 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | /** |
| 324 | 324 | * Checks through all the scheduled jobs that are expected to exist |
| 325 | + * @param string $queue |
|
| 325 | 326 | */ |
| 326 | 327 | public function checkdefaultJobs($queue = null) { |
| 327 | 328 | $queue = $queue ?: QueuedJob::QUEUED; |
@@ -375,7 +376,7 @@ discard block |
||
| 375 | 376 | * Attempt to restart a stalled job |
| 376 | 377 | * |
| 377 | 378 | * @param QueuedJobDescriptor $stalledJob |
| 378 | - * @return bool True if the job was successfully restarted |
|
| 379 | + * @return boolean|null True if the job was successfully restarted |
|
| 379 | 380 | */ |
| 380 | 381 | protected function restartStalledJob($stalledJob) { |
| 381 | 382 | if ($stalledJob->ResumeCounts < Config::inst()->get(__CLASS__, 'stall_threshold')) { |
@@ -791,6 +792,9 @@ discard block |
||
| 791 | 792 | } |
| 792 | 793 | } |
| 793 | 794 | |
| 795 | + /** |
|
| 796 | + * @param double $size |
|
| 797 | + */ |
|
| 794 | 798 | protected function humanReadable($size) { |
| 795 | 799 | $filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"); |
| 796 | 800 | return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 Bytes'; |