| Conditions | 5 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function apply(ImageInterface $image): ImageInterface |
||
| 29 | { |
||
| 30 | if ($this->quality === 'default') { |
||
| 31 | return $image; |
||
| 32 | } |
||
| 33 | |||
| 34 | if ($this->quality === 'gray') { |
||
| 35 | return $image->greyscale(); |
||
| 36 | } |
||
| 37 | |||
| 38 | if ($this->quality === 'color') { |
||
| 39 | return $image; |
||
| 40 | } |
||
| 41 | |||
| 42 | if ($this->quality === 'bitonal') { |
||
| 43 | return $image; |
||
| 44 | } |
||
| 47 |
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: