1 | <?php declare(strict_types=1); |
||
14 | class Processor |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * Checks to perform |
||
19 | * |
||
20 | * @var array<CheckInterface> |
||
21 | */ |
||
22 | protected $checks = []; |
||
23 | |||
24 | /** |
||
25 | * @var FeedIo |
||
26 | */ |
||
27 | protected $feedIo; |
||
28 | |||
29 | /** |
||
30 | * @param FeedIo $feedIo |
||
31 | */ |
||
32 | public function __construct(FeedIo $feedIo) |
||
36 | |||
37 | /** |
||
38 | * @param CheckInterface $check |
||
39 | * @return $this |
||
40 | */ |
||
41 | public function add(CheckInterface $check): Processor |
||
47 | |||
48 | /** |
||
49 | * @param string $url |
||
50 | * @return Result |
||
51 | */ |
||
52 | public function run(string $url): Result |
||
72 | |||
73 | } |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.