function UploadedFile::__construct
Same name in this branch
- 11.1.x vendor/guzzlehttp/psr7/src/UploadedFile.php \GuzzleHttp\Psr7\UploadedFile::__construct()
- 11.1.x vendor/symfony/http-foundation/File/UploadedFile.php \Symfony\Component\HttpFoundation\File\UploadedFile::__construct()
Overrides UploadedFile::__construct
File
-
vendor/
symfony/ psr-http-message-bridge/ Factory/ UploadedFile.php, line 26
Class
- UploadedFile
- @author Nicolas Grekas <p@tchwork.com>
Namespace
Symfony\Bridge\PsrHttpMessage\FactoryCode
public function __construct(UploadedFileInterface $psrUploadedFile, callable $getTemporaryPath) {
$error = $psrUploadedFile->getError();
$path = '';
if (\UPLOAD_ERR_NO_FILE !== $error) {
$path = $psrUploadedFile->getStream()
->getMetadata('uri') ?? '';
if ($this->test = !\is_string($path) || !is_uploaded_file($path)) {
$path = $getTemporaryPath();
$psrUploadedFile->moveTo($path);
}
}
parent::__construct($path, (string) $psrUploadedFile->getClientFilename(), $psrUploadedFile->getClientMediaType(), $psrUploadedFile->getError(), $this->test);
}