1 | <?php |
||
22 | class SearchHandler |
||
23 | { |
||
24 | /** |
||
25 | * @var EntityManagerInterface |
||
26 | */ |
||
27 | private $em; |
||
28 | |||
29 | /** |
||
30 | * SearchHandler constructor. |
||
31 | * |
||
32 | * @param EntityManagerInterface $em |
||
33 | */ |
||
34 | public function __construct(EntityManagerInterface $em) |
||
38 | |||
39 | /** |
||
40 | * @return Specification |
||
41 | */ |
||
42 | protected function createSpecification() |
||
46 | |||
47 | /** |
||
48 | * @param SearchCommand $command |
||
49 | */ |
||
50 | public function handle(EntityCommandInterface $command) |
||
61 | |||
62 | /** |
||
63 | * @param EntityCommandInterface|SearchCommand $command |
||
64 | * @return Specification |
||
65 | */ |
||
66 | protected function buildSpecification(EntityCommandInterface $command) |
||
85 | |||
86 | /** |
||
87 | * @param SearchCommand $command |
||
88 | * @return RepositoryInterface |
||
89 | */ |
||
90 | protected function getRepository(EntityCommand $command) |
||
94 | } |
||
95 |
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.