Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 2.5 |
Changes | 0 |
1 | <?php |
||
27 | public function stringify(iterable|string|object $data, bool $prettyPrint = true): string |
||
28 | { |
||
29 | 1 | if (!$data instanceof Media) { |
|
30 | throw new InvalidArgumentException( |
||
31 | 'DataUrlMapper expects object of type Media, ' . (gettype($data)) . ' given' |
||
32 | ); |
||
33 | } |
||
34 | 1 | return sprintf('data:%s;base64,%s', $data->getContentType(), base64_encode($data->getContent())); |
|
35 | } |
||
53 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.