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.
Completed
Push — master ( 5ad53e...930849 )
by Aleh
29:28 queued 27:44
created

RRule::getStartDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Scheduler\Job;
4
5
use DateTimeInterface;
6
use Recurr\Rule as RecurrRule;
7
use Recurr\Recurrence;
8
use Recurr\Transformer\ArrayTransformer;
9
use Recurr\Transformer\Constraint\BetweenConstraint;
10
11
/**
12
 * Class RRule
13
 * @package Scheduler\Job
14
 * @author Aleh Hutnikau, <[email protected]>
15
 */
16
class RRule extends AbstractRule
17
{
18
19
    /**
20
     * @param DateTimeInterface $from
21
     * @param DateTimeInterface $to
22
     * @param boolean $inc
23
     * @throws
24
     * @return DateTimeInterface[]
25 11
     */
26
    public function getRecurrences(DateTimeInterface $from, DateTimeInterface $to, $inc = true)
27 11
    {
28 11
        $rRule = new RecurrRule($this->getRrule(), $this->getStartDate());
29 11
        $rRuleTransformer = new ArrayTransformer();
30
        $constraint = new BetweenConstraint($from, $to, $inc);
31
        $recurrenceCollection = $rRuleTransformer->transform($rRule, $constraint);
32
        $result = [];
33
        /** @var Recurrence $recurrence */
34 15
        foreach ($recurrenceCollection as $recurrence) {
35
            $result[] = $recurrence->getStart();
36 15
        }
37
        return $result;
38
    }
39
}