Skip to content

Commit e255b8d

Browse files
committed
Remove unused code to deserialize binary (file)
1 parent 7544e2d commit e255b8d

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

templates/ObjectSerializer.mustache

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -224,31 +224,6 @@ class ObjectSerializer
224224
}
225225
}
226226

227-
if ($class === '\SplFileObject') {
228-
$data = Utils::streamFor($data);
229-
230-
/** @var \Psr\Http\Message\StreamInterface $data */
231-
232-
// determine file name
233-
if (
234-
is_array($httpHeaders)
235-
&& array_key_exists('Content-Disposition', $httpHeaders)
236-
&& preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)
237-
) {
238-
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]);
239-
} else {
240-
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
241-
}
242-
243-
$file = fopen($filename, 'w');
244-
while ($chunk = $data->read(200)) {
245-
fwrite($file, $chunk);
246-
}
247-
fclose($file);
248-
249-
return new \SplFileObject($filename, 'r');
250-
}
251-
252227
/** @psalm-suppress ParadoxicalCondition */
253228
if (in_array($class, [{{&primitives}}], true)) {
254229
settype($data, $class);

0 commit comments

Comments
 (0)