4 * @see https://github.com/laminas/laminas-diactoros for the canonical source repository
5 * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md
6 * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License
9 declare(strict_types=1);
11 namespace Laminas\Diactoros\Exception;
17 class UploadedFileErrorException extends RuntimeException implements ExceptionInterface
19 public static function forUnmovableFile() : self
21 return new self('Error occurred while moving uploaded file');
24 public static function dueToStreamUploadError(string $error) : self
26 return new self(sprintf(
27 'Cannot retrieve stream due to upload error: %s',
32 public static function dueToUnwritablePath() : self
34 return new self('Unable to write to designated path');
37 public static function dueToUnwritableTarget(string $targetDirectory) : self
39 return new self(sprintf(
40 'The target directory `%s` does not exists or is not writable',