Passed
Push — master ( e3a8e9...fa6d7a )
by Nils
05:20 queued 10s
created

TimeFilter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 6 1
A run() 0 11 2
1
<?php
2
3
namespace Leankoala\HealthFoundation\Filter\Basic;
4
5
use Leankoala\HealthFoundation\Check\Result;
6
use Leankoala\HealthFoundation\Filter\BasicFilter;
7
8
class TimeFilter extends BasicFilter
9
{
10
    private $startDateTime;
11
12
    private $endDateTime;
13
14
    public function init($month, $day, $hour, $minute, $interval)
0 ignored issues
show
Unused Code introduced by
The parameter $day is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public function init($month, /** @scrutinizer ignore-unused */ $day, $hour, $minute, $interval)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $interval is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public function init($month, $day, $hour, $minute, /** @scrutinizer ignore-unused */ $interval)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $minute is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public function init($month, $day, $hour, /** @scrutinizer ignore-unused */ $minute, $interval)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $month is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public function init(/** @scrutinizer ignore-unused */ $month, $day, $hour, $minute, $interval)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $hour is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public function init($month, $day, /** @scrutinizer ignore-unused */ $hour, $minute, $interval)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        throw new \RuntimeException('This filter is not implemented yet');
17
18
        $this->startDateTime = new \DateTime($startDateTime);
0 ignored issues
show
Unused Code introduced by
$this->startDateTime = n...ateTime($startDateTime) is not reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
19
        $this->endDateTime = new \DateTime($endDateTime);
20
    }
21
22
    public function run()
23
    {
24
        $result = $this->getCheck()->run();
25
26
        // @todo handle metric aware checks
27
28
        if ($result->getStatus() == Result::STATUS_FAIL) {
29
30
31
        } else {
32
            return $result;
33
        }
34
    }
35
}
36