@@ -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 | */ |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | /** |
| 157 | 157 | * Start a job (or however the queue handler determines it should be started) |
| 158 | 158 | * |
| 159 | - * @param JobDescriptor $jobDescriptor |
|
| 159 | + * @param QueuedJobDescriptor $jobDescriptor |
|
| 160 | 160 | * @param date $startAfter |
| 161 | 161 | */ |
| 162 | 162 | public function startJob($jobDescriptor, $startAfter = null) { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * Copies data from a job into a descriptor for persisting |
| 173 | 173 | * |
| 174 | 174 | * @param QueuedJob $job |
| 175 | - * @param JobDescriptor $jobDescriptor |
|
| 175 | + * @param DataObject $jobDescriptor |
|
| 176 | 176 | */ |
| 177 | 177 | protected function copyJobToDescriptor($job, $jobDescriptor) { |
| 178 | 178 | $data = $job->getJobData(); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * Attempt to restart a stalled job |
| 319 | 319 | * |
| 320 | 320 | * @param QueuedJobDescriptor $stalledJob |
| 321 | - * @return bool True if the job was successfully restarted |
|
| 321 | + * @return boolean|null True if the job was successfully restarted |
|
| 322 | 322 | */ |
| 323 | 323 | protected function restartStalledJob($stalledJob) { |
| 324 | 324 | if ($stalledJob->ResumeCounts < Config::inst()->get(__CLASS__, 'stall_threshold')) { |
@@ -728,6 +728,9 @@ discard block |
||
| 728 | 728 | } |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | + /** |
|
| 732 | + * @param double $size |
|
| 733 | + */ |
|
| 731 | 734 | protected function humanReadable($size) { |
| 732 | 735 | $filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"); |
| 733 | 736 | return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 Bytes'; |