@@ -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'); | 
                                                        
@@ -28,7 +28,7 @@  | 
                                                    ||
| 28 | 28 | /**  | 
                                                        
| 29 | 29 | * @inheritdoc  | 
                                                        
| 30 | 30 | *  | 
                                                        
| 31 | - * @return null|int  | 
                                                        |
| 31 | + * @return integer  | 
                                                        |
| 32 | 32 | */  | 
                                                        
| 33 | 33 |  	public function getId() { | 
                                                        
| 34 | 34 | return $this->id;  | 
                                                        
@@ -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 | }  | 
                                                        
@@ -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();  | 
                                                        
@@ -315,7 +315,7 @@ discard block  | 
                                                    ||
| 315 | 315 | * Attempt to restart a stalled job  | 
                                                        
| 316 | 316 | *  | 
                                                        
| 317 | 317 | * @param QueuedJobDescriptor $stalledJob  | 
                                                        
| 318 | - * @return bool True if the job was successfully restarted  | 
                                                        |
| 318 | + * @return boolean|null True if the job was successfully restarted  | 
                                                        |
| 319 | 319 | */  | 
                                                        
| 320 | 320 |  	protected function restartStalledJob($stalledJob) { | 
                                                        
| 321 | 321 |  		if ($stalledJob->ResumeCounts < Config::inst()->get(__CLASS__, 'stall_threshold')) { | 
                                                        
@@ -357,7 +357,7 @@ discard block  | 
                                                    ||
| 357 | 357 | * @param QueuedJobDescriptor $jobDescriptor  | 
                                                        
| 358 | 358 | * The Job descriptor of a job to prepare for execution  | 
                                                        
| 359 | 359 | *  | 
                                                        
| 360 | - * @return QueuedJob|boolean  | 
                                                        |
| 360 | + * @return QueuedJob  | 
                                                        |
| 361 | 361 | */  | 
                                                        
| 362 | 362 |  	protected function initialiseJob(QueuedJobDescriptor $jobDescriptor) { | 
                                                        
| 363 | 363 | // create the job class  | 
                                                        
@@ -725,6 +725,9 @@ discard block  | 
                                                    ||
| 725 | 725 | }  | 
                                                        
| 726 | 726 | }  | 
                                                        
| 727 | 727 | |
| 728 | + /**  | 
                                                        |
| 729 | + * @param double $size  | 
                                                        |
| 730 | + */  | 
                                                        |
| 728 | 731 |  	protected function humanReadable($size) { | 
                                                        
| 729 | 732 |  		$filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"); | 
                                                        
| 730 | 733 | return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 Bytes';  | 
                                                        
@@ -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 | */  |