CoreFiles by mySites.guru
UploadedFileFactory.php31 lines, 756 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
795235fc444426341da2ad4314f2ee63
sha1
59345a96ca7bfa03d2f5614096b329b2782f0b3e
sha256
8080878ec20b0efbfccb695bb6292cf405bc736d6676480e72cb8dbecb19c583
<?php

declare(strict_types=1);

namespace Laminas\Diactoros;

use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UploadedFileFactoryInterface;
use Psr\Http\Message\UploadedFileInterface;

use const UPLOAD_ERR_OK;

class UploadedFileFactory implements UploadedFileFactoryInterface
{
    /**
     * {@inheritDoc}
     */
    public function createUploadedFile(
        StreamInterface $stream,
        ?int $size = null,
        int $error = UPLOAD_ERR_OK,
        ?string $clientFilename = null,
        ?string $clientMediaType = null
    ): UploadedFileInterface {
        if ($size === null) {
            $size = $stream->getSize();
        }

        return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType);
    }
}

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