1 | <?php |
||
10 | abstract class Translator { |
||
11 | |||
12 | /** |
||
13 | * Translate a Fulfillable to foreign data |
||
14 | * |
||
15 | * @param Fulfillable $fulfillable |
||
16 | * @return mixed |
||
17 | */ |
||
18 | public function fulfillable_to_foreign( Fulfillable $fulfillable ) { |
||
29 | |||
30 | /** |
||
31 | * Translate a Condition to foreign data |
||
32 | * |
||
33 | * @param Condition $condition |
||
34 | * @return mixed |
||
35 | */ |
||
36 | abstract protected function condition_to_foreign( Condition $condition ); |
||
37 | |||
38 | /** |
||
39 | * Translate a Fulfillable_Collection to foreign data |
||
40 | * |
||
41 | * @param Fulfillable_Collection $fulfillable_collection |
||
42 | * @return mixed |
||
43 | */ |
||
44 | abstract protected function fulfillable_collection_to_foreign( Fulfillable_Collection $fulfillable_collection ); |
||
45 | |||
46 | /** |
||
47 | * Translate foreign data to a Fulfillable |
||
48 | * |
||
49 | * @param mixed $foreign |
||
50 | * @return Fulfillable |
||
51 | */ |
||
52 | abstract public function foreign_to_fulfillable( $foreign ); |
||
53 | } |
||
54 |
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.