Conditions | 4 |
Paths | 8 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | protected function handlePolygonParams( array &$params, Polygon &$polygon ) { |
||
28 | if ( $fillColor = array_shift( $params ) ) { |
||
29 | $polygon->setFillColor( $fillColor ); |
||
30 | } |
||
31 | |||
32 | if ( $fillOpacity = array_shift( $params ) ) { |
||
33 | $polygon->setFillOpacity( $fillOpacity ); |
||
34 | } |
||
35 | |||
36 | if ( $showOnlyOnHover = array_shift( $params ) ) { |
||
37 | $polygon->setOnlyVisibleOnHover( strtolower( trim( $showOnlyOnHover ) ) === 'on' ); |
||
38 | } |
||
39 | } |
||
40 | |||
42 |
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.