Passed
Push — master ( e5baf6...0dce86 )
by Jhao
02:41
created

Media::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
/**
4
 * This file is part of PhpAidc LabelPrinter package.
5
 *
6
 *  © Appwilio (https://appwilio.com)
7
 *  © JhaoDa (https://github.com/jhaoda)
8
 *
9
 *  For the full copyright and license information, please view the LICENSE
10
 *  file that was distributed with this source code.
11
 */
12
13
declare(strict_types=1);
14
15
namespace PhpAidc\LabelPrinter\Label;
16
17
use PhpAidc\LabelPrinter\Enum\Unit;
18
use PhpAidc\LabelPrinter\Contract\Media as MediaContract;
19
20
final class Media implements MediaContract
21
{
22
    /** @var Unit|null */
23
    private $unit;
24
25
    /** @var float|null */
26
    private $width;
27
28
    /** @var float|null */
29
    private $height;
30
31 9
    public function __construct(?Unit $unit = null, ?float $width = null, ?float $height = null)
32
    {
33 9
        $this->unit = $unit;
34 9
        $this->width = $width;
35 9
        $this->height = $height;
36 9
    }
37
38
    public function getUnit(): ?Unit
39
    {
40
        return $this->unit;
41
    }
42
43
    public function getWidth(): ?float
44
    {
45
        return $this->width;
46
    }
47
48
    public function getHeight(): ?float
49
    {
50
        return $this->height;
51
    }
52
}
53