Passed
Pull Request — master (#8)
by Kevin
17:55
created

MockTaskRunner   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 3 1
A supports() 0 3 1
1
<?php
2
3
namespace Zenstruck\ScheduleBundle\Tests\Fixture;
4
5
use Zenstruck\ScheduleBundle\Schedule\Task;
6
use Zenstruck\ScheduleBundle\Schedule\Task\Result;
7
use Zenstruck\ScheduleBundle\Schedule\Task\TaskRunner;
8
9
/**
10
 * @author Kevin Bond <[email protected]>
11
 */
12
final class MockTaskRunner implements TaskRunner
13
{
14
    /**
15
     * @param MockTask|Task $task
16
     */
17
    public function __invoke(Task $task): Result
18
    {
19
        return $task->getResult();
0 ignored issues
show
Bug introduced by
The method getResult() does not exist on Zenstruck\ScheduleBundle\Schedule\Task. It seems like you code against a sub-type of Zenstruck\ScheduleBundle\Schedule\Task such as Zenstruck\ScheduleBundle\Tests\Fixture\MockTask. ( Ignorable by Annotation )

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

19
        return $task->/** @scrutinizer ignore-call */ getResult();
Loading history...
20
    }
21
22
    public function supports(Task $task): bool
23
    {
24
        return $task instanceof MockTask;
25
    }
26
}
27