Skip to content

Commit f17f662

Browse files
committed
refactor: simplifies File::fromArray
1 parent cb4406e commit f17f662

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Files/DTO/File.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,7 @@ public static function fromArray(array $array): File
428428
if (!isset($array['mimeType']) || !isset($array['base64Data'])) {
429429
throw new \InvalidArgumentException('Inline file requires mimeType and base64Data.');
430430
}
431-
// Create data URI from base64 data and mime type
432-
$mimeType = $array['mimeType'];
433-
$base64Data = $array['base64Data'];
434-
$dataUri = sprintf('data:%s;base64,%s', $mimeType, $base64Data);
435-
return new self($dataUri);
431+
return new self($array['base64Data'], $array['mimeType']);
436432
}
437433
}
438434
}

0 commit comments

Comments
 (0)