Completed
Push — master ( 79d36b...3588f7 )
by Eric
66:08 queued 03:30
created

UploadedBase64File::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 6
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Base64 File package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\Base64FileBundle\Model;
13
14
use Symfony\Component\HttpFoundation\File\UploadedFile;
15
16
/**
17
 * @author GeLo <[email protected]>
18
 */
19
class UploadedBase64File extends UploadedFile implements Base64FileInterface
20
{
21
    use Base64FileTrait {
22
        __construct as private constructTrait;
23
    }
24
25
    /**
26
     * @param string|resource $value
27
     * @param string          $originalName
28
     * @param string|null     $mimeType
29
     * @param int|null        $size
30
     * @param int|null        $error
31
     * @param bool            $test
32
     */
33 225
    public function __construct($value, $originalName, $mimeType = null, $size = null, $error = null, $test = false)
34
    {
35 225
        $this->constructTrait($value);
36 165
        $metadata = stream_get_meta_data($this->resource);
37
38 165
        parent::__construct($metadata['uri'], $originalName, $mimeType, $size, $error, $test);
39 165
    }
40
}
41