Use formal type hints instead of informal PHPDoc

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2020-07-06 10:13:23 +02:00
parent 9b10d35477
commit b1cdd0dd9b
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 9 additions and 21 deletions

View File

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

View File

@ -42,19 +42,17 @@ interface IJob {
* @param ILogger|null $logger
* @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
*/
public function setId($id);
public function setId(int $id);
/**
* @param int $lastRun
* @since 7.0.0
*/
public function setLastRun($lastRun);
public function setLastRun(int $lastRun);
/**
* @param mixed $argument