diff options
author | Tim Starling <tstarling@wikimedia.org> | 2023-03-24 13:48:54 +1100 |
---|---|---|
committer | Krinkle <krinkle@fastmail.com> | 2023-03-25 00:30:15 +0000 |
commit | 317b460500725f81797d27c33bd68756055fb44c (patch) | |
tree | baf473c604b8d78647bc590d2555e0ac47eb97d2 /includes/jobqueue/Job.php | |
parent | 580ec48e5b322e505297f3eed0ebccbd269c2166 (diff) | |
download | mediawikicore-317b460500725f81797d27c33bd68756055fb44c.tar.gz mediawikicore-317b460500725f81797d27c33bd68756055fb44c.zip |
Fix even more PHPStorm inspections (#3)
* Inappropriate @inheritDoc usage. Arguably all @inheritDoc is
inappropriate but these are the ones PHPStorm flags as misleading
due to the method not being inherited.
* Doc comment type does not match actual argument/return type.
* I replaced "@return void|never" with "@return void" since never means
never, it doesn't make sense for it to be conditional. If a method
can return (even if that is unlikely) then @return contains the type
that it returns. "@return never" means that there is no such type
because the method never returns.
* Incomplete/partial/broken doc tags
Change-Id: Ide86bd6d2b44387f37d234c2b059d6fbc42ec962
Diffstat (limited to 'includes/jobqueue/Job.php')
-rw-r--r-- | includes/jobqueue/Job.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php index 05b14c2cf65d..679814c83b23 100644 --- a/includes/jobqueue/Job.php +++ b/includes/jobqueue/Job.php @@ -192,9 +192,8 @@ abstract class Job implements RunnableJob { * @since 1.22 */ public function getReleaseTimestamp() { - return isset( $this->params['jobReleaseTimestamp'] ) - ? wfTimestampOrNull( TS_UNIX, $this->params['jobReleaseTimestamp'] ) - : null; + $time = wfTimestampOrNull( TS_UNIX, $this->params['jobReleaseTimestamp'] ?? null ); + return $time ? (int)$time : null; } /** @@ -202,9 +201,8 @@ abstract class Job implements RunnableJob { * @since 1.26 */ public function getQueuedTimestamp() { - return isset( $this->metadata['timestamp'] ) - ? wfTimestampOrNull( TS_UNIX, $this->metadata['timestamp'] ) - : null; + $time = wfTimestampOrNull( TS_UNIX, $this->metadata['timestamp'] ?? null ); + return $time ? (int)$time : null; } /** |