Passed
Pull Request — master (#8)
by Kevin
19:20
created

BetweenTimeHandler::supports()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Zenstruck\ScheduleBundle\Schedule\Extension\Handler;
4
5
use Zenstruck\ScheduleBundle\Schedule\Extension;
6
use Zenstruck\ScheduleBundle\Schedule\Extension\BetweenTimeExtension;
7
use Zenstruck\ScheduleBundle\Schedule\Extension\ExtensionHandler;
8
use Zenstruck\ScheduleBundle\Schedule\Task\TaskRunContext;
9
10
/**
11
 * @author Kevin Bond <[email protected]>
12
 */
13
final class BetweenTimeHandler extends ExtensionHandler
14
{
15
    /**
16
     * @param BetweenTimeExtension|Extension $extension
17
     */
18
    public function filterTask(TaskRunContext $context, Extension $extension): void
19
    {
20
        $extension->filter($context->getTask()->getTimezone());
0 ignored issues
show
Bug introduced by
The method filter() does not exist on Zenstruck\ScheduleBundle\Schedule\Extension. It seems like you code against a sub-type of Zenstruck\ScheduleBundle\Schedule\Extension such as Zenstruck\ScheduleBundle...on\BetweenTimeExtension. ( Ignorable by Annotation )

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

20
        $extension->/** @scrutinizer ignore-call */ 
21
                    filter($context->getTask()->getTimezone());
Loading history...
21
    }
22
23
    public function supports(Extension $extension): bool
24
    {
25
        return $extension instanceof BetweenTimeExtension;
26
    }
27
}
28