Merge pull request #21665 from nextcloud/debt/noid/job-list

Fix wrong phpdoc for execute method
This commit is contained in:
Morris Jobke 2020-07-06 11:14:14 +02:00 committed by GitHub
commit 6c825ee9a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 23 deletions

View File

@ -28,29 +28,20 @@
namespace OC\BackgroundJob; namespace OC\BackgroundJob;
use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\IJobList;
use OCP\ILogger; use OCP\ILogger;
abstract class Job implements IJob { abstract class Job implements IJob {
/** /** @var int */
* @var int $id
*/
protected $id; protected $id;
/** /** @var int */
* @var int $lastRun
*/
protected $lastRun; protected $lastRun;
/** /** @var mixed */
* @var mixed $argument
*/
protected $argument; protected $argument;
/** public function execute(IJobList $jobList, ILogger $logger = null) {
* @param JobList $jobList
* @param ILogger|null $logger
*/
public function execute($jobList, ILogger $logger = null) {
$jobList->setLastRun($this); $jobList->setLastRun($this);
if ($logger === null) { if ($logger === null) {
$logger = \OC::$server->getLogger(); $logger = \OC::$server->getLogger();
@ -76,11 +67,11 @@ abstract class Job implements IJob {
abstract protected function run($argument); abstract protected function run($argument);
public function setId($id) { public function setId(int $id) {
$this->id = $id; $this->id = $id;
} }
public function setLastRun($lastRun) { public function setLastRun(int $lastRun) {
$this->lastRun = $lastRun; $this->lastRun = $lastRun;
} }

View File

@ -25,6 +25,7 @@
namespace OC\BackgroundJob; namespace OC\BackgroundJob;
use OCP\BackgroundJob\IJobList;
use OCP\ILogger; use OCP\ILogger;
/** /**
@ -49,7 +50,7 @@ abstract class TimedJob extends Job {
/** /**
* run the job if * run the job if
* *
* @param JobList $jobList * @param IJobList $jobList
* @param ILogger|null $logger * @param ILogger|null $logger
*/ */
public function execute($jobList, ILogger $logger = null) { public function execute($jobList, ILogger $logger = null) {

View File

@ -38,23 +38,21 @@ interface IJob {
/** /**
* Run the background job with the registered argument * Run the background job with the registered argument
* *
* @param \OCP\BackgroundJob\IJobList $jobList The job list that manages the state of this job * @param IJobList $jobList The job list that manages the state of this job
* @param ILogger|null $logger * @param ILogger|null $logger
* @since 7.0.0 * @since 7.0.0
*/ */
public function execute($jobList, ILogger $logger = null); public function execute(IJobList $jobList, ILogger $logger = null);
/** /**
* @param int $id
* @since 7.0.0 * @since 7.0.0
*/ */
public function setId($id); public function setId(int $id);
/** /**
* @param int $lastRun
* @since 7.0.0 * @since 7.0.0
*/ */
public function setLastRun($lastRun); public function setLastRun(int $lastRun);
/** /**
* @param mixed $argument * @param mixed $argument