Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function fulfillable_to_foreign( Fulfillable $fulfillable ) { |
||
19 | if ( is_a( $fulfillable, 'Carbon_Fields\\Container\\Condition\\Condition' ) ) { |
||
20 | return $this->condition_to_foreign( $fulfillable ); |
||
1 ignored issue
–
show
|
|||
21 | } |
||
22 | |||
23 | if ( is_a( $fulfillable, 'Carbon_Fields\\Container\\Fulfillable\\Fulfillable_Collection' ) ) { |
||
24 | return $this->fulfillable_collection_to_foreign( $fulfillable ); |
||
1 ignored issue
–
show
|
|||
25 | } |
||
26 | |||
27 | Incorrect_Syntax_Exception::raise( 'Attempted to translate an unsupported object: ' . print_r( $fulfillable, true ) ); |
||
1 ignored issue
–
show
|
|||
28 | } |
||
29 | |||
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.