WordPress\AiClientDependencies\Nyholm\Psr7
UploadedFile::getStream
Method of the class: UploadedFile{}
No Hooks.
Returns
null. Nothing (null).
Usage
$UploadedFile = new UploadedFile(); $UploadedFile->getStream(): StreamInterface;
UploadedFile::getStream() UploadedFile::getStream code WP 7.0
public function getStream(): StreamInterface
{
$this->validateActive();
if ($this->stream instanceof StreamInterface) {
return $this->stream;
}
if (\false === $resource = @\fopen($this->file, 'r')) {
throw new \RuntimeException(\sprintf('The file "%s" cannot be opened: %s', $this->file, \error_get_last()['message'] ?? ''));
}
return Stream::create($resource);
}