| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | public function getArrayRepresentation () : array |
||
| 50 | { |
||
| 51 | $result = [ "type" => $this->getType(), "class" => get_class( $this ), "options" => [] ]; |
||
| 52 | |||
| 53 | foreach ( $this->availableOptions as $currentOption ) { |
||
| 54 | $result["options"][$currentOption] = $this->$currentOption; |
||
| 55 | } |
||
| 56 | |||
| 57 | return $result; |
||
| 58 | } |
||
| 60 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: