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.

ChronoIterator::rewind()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
3
namespace COG\ChronoShifter\Iterator;
4
5
use COG\ChronoShifter\Shifter\Shifter;
6
7
/**
8
 * @author Kristjan Siimson <[email protected]>
9
 * @package Iterator\Domain
10
 */
11
class ChronoIterator implements \Iterator
12
{
13
    /**
14
     * @var Shifter
15
     */
16
    private $shifter;
17
18
    /**
19
     * @var string
20
     */
21
    private $date;
22
23
    /**
24
     * @var \DateTime
25
     */
26
    private $startDate;
27
28
    /**
29
     * @param Shifter $shifter
30
     * @param string $date
31
     */
32 8
    public function __construct(Shifter $shifter, $date)
33
    {
34 8
        $this->shifter = $shifter;
35 8
        $this->date = $this->startDate = $date;
0 ignored issues
show
Documentation Bug introduced by
It seems like $date of type string is incompatible with the declared type object<DateTime> of property $startDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
36
37 8
        $this->rewind();
38 8
    }
39
40
    /**
41
     * @return \DateTime
42
     */
43 4
    public function current()
44
    {
45 4
        return $this->date;
46
    }
47
48
    /**
49
     * @return void
50
     */
51 8
    public function next()
52
    {
53 8
        $this->date = $this->shifter->shift($this->date);
54 8
    }
55
56
    /**
57
     * @return int
58
     */
59 1
    public function key()
60
    {
61 1
        return strtotime($this->date);
62
    }
63
64
    /**
65
     * @return boolean The return value will be casted to boolean and then evaluated.
66
     * Returns true on success or false on failure.
67
     */
68 2
    public function valid()
69
    {
70 2
        return true;
71
    }
72
73
    /**
74
     * @return void
75
     */
76 8
    public function rewind()
77
    {
78 8
        $this->date = $this->startDate;
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->startDate of type object<DateTime> is incompatible with the declared type string of property $date.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
79 8
        $this->next();
80
    }
81
}