private static function makeFile(array $data, bool $throwException) { $file = new UploadedFile($data); if ($throwException && !$file->isValid()) { throw new UploadException($file); } return $file; }
public function __construct(UploadedFile $file) { parent::__construct($file->getErrorMessage(), $file->getErrorCode()); $this->uploadedFile = $file; }