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.

ActionIterator::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 8
cts 8
cp 1
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 4
crap 2
1
<?php
2
3
namespace Scheduler\Action;
4
5
use Recurr\Recurrence;
6
use DateTimeInterface;
7
use Scheduler\Job\JobInterface;
8
9
/**
10
 * Class ActionIterator
11
 * @package Scheduler
12
 * @author Aleh Hutnikau, <[email protected]>
13
 */
14
class ActionIterator extends \ArrayIterator
15
{
16
17
    /**
18
     * RRuleIterator constructor.
19
     * @param JobInterface $job
20
     * @param DateTimeInterface $after
21
     * @param DateTimeInterface $before
22
     * @param bool $inc
23
     * @throws
24
     */
25 13
    public function __construct(JobInterface $job, DateTimeInterface $after, DateTimeInterface $before, $inc = true)
26
    {
27 13
        $dates = $job->getRRule()->getRecurrences($after, $before, $inc);
28 13
        $actions = [];
29
        /** @var Recurrence $recurrence */
30 13
        foreach ($dates as $recurrence) {
31 12
            $actions[] = new CallableAction($job, $recurrence);
32 13
        }
33 13
        parent::__construct($actions);
34 13
    }
35
36
}