CoreFiles by mySites.guru
UploadedFileErrorException.php38 lines, 928 bytes, from Joomla_5.3.3-Stable-Full_Package.zip
Raw History Compare with 5.3.2
md5
28c9a18f8918993ac14f662be0b68285
sha1
97786444af11b9327424117732092c27de274ff9
sha256
2576473dfe32f647b5f045bfa246cf0af89c01942404c8bd4f8c674865c7998e
<?php

declare(strict_types=1);

namespace Laminas\Diactoros\Exception;

use RuntimeException;

use function sprintf;

class UploadedFileErrorException extends RuntimeException implements ExceptionInterface
{
    public static function forUnmovableFile(): self
    {
        return new self('Error occurred while moving uploaded file');
    }

    public static function dueToStreamUploadError(string $error): self
    {
        return new self(sprintf(
            'Cannot retrieve stream due to upload error: %s',
            $error
        ));
    }

    public static function dueToUnwritablePath(): self
    {
        return new self('Unable to write to designated path');
    }

    public static function dueToUnwritableTarget(string $targetDirectory): self
    {
        return new self(sprintf(
            'The target directory `%s` does not exist or is not writable',
            $targetDirectory
        ));
    }
}

The same content is in 158 releases, Joomla 5.0.0-alpha1 to 6.3.0-alpha1. See them all, or every version of this file.