Passed
Pull Request — master (#58)
by Daniel
06:28
created

FileInfo::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 6
dl 0
loc 9
ccs 8
cts 8
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Components Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentsBundle\Entity\Core;
15
16
use Silverback\ApiComponentsBundle\Entity\Utility\IdTrait;
17
18
/**
19
 * Optional entity only mapped if imagine installed.
20
 *
21
 * @author Daniel West <[email protected]>
22
 */
23
class FileInfo
24
{
25
    use IdTrait;
26
27
    public string $path;
28
    public string $mimeType;
29
    public int $fileSize;
30
    public ?int $width;
31
    public ?int $height;
32
    public ?string $filter;
33
34 2
    public function __construct(string $path, string $mimeType, int $fileSize, ?int $width, ?int $height, ?string $filter = null)
35
    {
36 2
        $this->setId();
37 2
        $this->path = $path;
38 2
        $this->mimeType = $mimeType;
39 2
        $this->width = $width;
40 2
        $this->height = $height;
41 2
        $this->fileSize = $fileSize;
42 2
        $this->filter = $filter;
43 2
    }
44
}
45