assert($request instanceof IncomingRequest ||
$request instanceof CLIRequest
);
$this->request =
$request;
} /**
* Verifies that $name is the name of a valid uploaded file.
*/
public function uploaded(?string
$blank, string
$name): bool
{ if (!
($files =
$this->request->
getFileMultiple($name))) { $files =
[$this->request->
getFile($name)];
} foreach ($files as $file) { if ($file === null
) { return false;
} if (ENVIRONMENT === 'testing'
) { if ($file->
getError() !== 0
) { return false;
}