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.

OnOrAfter::accept()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 7
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
namespace COG\ChronoShifter\Iterator\Filter;
4
5
/**
6
 * @author Kristjan Siimson <[email protected]>
7
 * @package Iterator\Filter\Domain
8
 */
9 View Code Duplication
class OnOrAfter extends \FilterIterator
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    /**
12
     * @var string
13
     */
14
    private $date;
15
16
    /**
17
     * @param \Iterator $iterator
18
     * @param string $date
19
     */
20 1
    public function __construct(\Iterator $iterator, $date)
21
    {
22 1
        parent::__construct($iterator);
23 1
        $this->date = substr($date, 0, 10);
24 1
    }
25
26
    /**
27
     * @return bool
28
     */
29 1
    public function accept()
30
    {
31 1
        $current = new \DateTime(parent::current());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (current() instead of accept()). Are you sure this is correct? If so, you might want to change this to $this->current().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
32 1
        $current->setTime(0, 0, 0);
33
34 1
        return $current >= new \DateTime($this->date);
35
    }
36
}
37