Use formal type hints instead of informal PHPDoc
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
9b10d35477
commit
b1cdd0dd9b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue