Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2.0625 |
Changes | 0 |
1 | <?php |
||
43 | public function parse(mixed $data): object |
||
44 | { |
||
45 | 1 | $matches = Strings::match(strval($data), "@^data:([\w/]+?);(\w+?),(.*)$@si"); |
|
|
|||
46 | 1 | if (!$matches) { |
|
47 | throw new MappingException('Given data URL is invalid.'); |
||
48 | } |
||
49 | |||
50 | 1 | return new Media(base64_decode((string) $matches[3]), $matches[1]); |
|
51 | } |
||
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.