GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 17-17 lines in 2 locations

src/Extensions/WorkflowEmbargoExpiryExtension.php 2 locations

@@ 208-224 (lines=17) @@
205
     *
206
     * @param int $when Timestamp to start this job, or null to start immediately
207
     */
208
    protected function ensurePublishJob($when)
209
    {
210
        // Check if there is a prior job
211
        if ($this->owner->PublishJobID) {
212
            $job = $this->owner->PublishJob();
213
            // Use timestamp for sake of comparison.
214
            if ($job && $job->exists() && DBDatetime::create()->setValue($job->StartAfter)->getTimestamp() == $when) {
215
                return;
216
            }
217
            $this->clearPublishJob();
218
        }
219
220
        // Create a new job with the specified schedule
221
        $job = new WorkflowPublishTargetJob($this->owner, 'publish');
222
        $this->owner->PublishJobID = Injector::inst()->get(QueuedJobService::class)
223
                ->queueJob($job, $when ? date('Y-m-d H:i:s', $when) : null);
224
    }
225
226
    /**
227
     * Ensure the existence of an unpublish job at the specified time
@@ 231-247 (lines=17) @@
228
     *
229
     * @param int $when Timestamp to start this job, or null to start immediately
230
     */
231
    protected function ensureUnPublishJob($when)
232
    {
233
        // Check if there is a prior job
234
        if ($this->owner->UnPublishJobID) {
235
            $job = $this->owner->UnPublishJob();
236
            // Use timestamp for sake of comparison.
237
            if ($job && $job->exists() && DBDatetime::create()->setValue($job->StartAfter)->getTimestamp() == $when) {
238
                return;
239
            }
240
            $this->clearUnPublishJob();
241
        }
242
243
        // Create a new job with the specified schedule
244
        $job = new WorkflowPublishTargetJob($this->owner, 'unpublish');
245
        $this->owner->UnPublishJobID = Injector::inst()->get(QueuedJobService::class)
246
            ->queueJob($job, $when ? date('Y-m-d H:i:s', $when) : null);
247
    }
248
249
    public function onBeforeDuplicate($original, $doWrite)
250
    {