UploadedFileFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createUploadedFile() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Furious\Psr7\Factory;
6
7
use Furious\Psr7\UploadedFile;
8
use Psr\Http\Message\StreamInterface;
9
use Psr\Http\Message\UploadedFileFactoryInterface;
10
use Psr\Http\Message\UploadedFileInterface;
11
use const UPLOAD_ERR_OK;
12
13
class UploadedFileFactory implements UploadedFileFactoryInterface
14
{
15
    public function createUploadedFile(
16
        StreamInterface $stream, ?int $size = null, int $error = UPLOAD_ERR_OK,
17
        string $clientFilename = null, string $clientMediaType = null
18
    ): UploadedFileInterface
19
    {
20
        return new UploadedFile(
21
            $stream, $size ?? $stream->getSize(), $error,
22
            $clientFilename, $clientMediaType
23
        );
24
    }
25
}