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   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRecurrences() 0 13 2
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
}