| 1 | <?php declare(strict_types=1); |
||
| 13 | class Processor |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Checks to perform |
||
| 18 | * |
||
| 19 | * @var array<CheckInterface> |
||
| 20 | */ |
||
| 21 | protected $checks = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var FeedIo |
||
| 25 | */ |
||
| 26 | protected $feedIo; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param FeedIo $feedIo |
||
| 30 | */ |
||
| 31 | public function __construct(FeedIo $feedIo) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param CheckInterface $check |
||
| 38 | * @return $this |
||
| 39 | */ |
||
| 40 | public function add(CheckInterface $check): Processor |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $url |
||
| 49 | * @return Result |
||
| 50 | */ |
||
| 51 | public function run(string $url): Result |
||
| 71 | } |
||
| 72 |
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.