CoreFiles by mySites.guru
UploadedFileFactory.php33 lines, 786 bytes, from Joomla_6.2.0-beta2-Beta-Full_Package.zip
Raw History Compare with 6.2.0-beta1
md5
9a8f529826894a550e8c96de2167e5fe
sha1
56634115e3a65326c1ed3447adcafd00efeff342
sha256
4d99fcd4fa0c5e926d77c16f41b3065b49013e41d829cfbe05389f54201d2192
<?php

declare(strict_types=1);

namespace Laminas\Diactoros;

use Override;
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}
     */
    #[Override]
    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 32 releases, Joomla 6.1.0-alpha2 to 6.3.0-alpha1. See them all, or every version of this file.