Completed
Push — master ( 24e779...ef9a53 )
by Peter
12:37 queued 07:06
created

DataMeta::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * @author Peter Gribanov <[email protected]>
4
 */
5
6
namespace GpsLab\Component\ImageMeta;
7
8
class DataMeta
9
{
10
    /**
11
     * @var int
12
     */
13
    protected $width = 0;
14
15
    /**
16
     * @var int
17
     */
18
    protected $height = 0;
19
20
    /**
21
     * @var string
22
     */
23
    protected $mime = '';
24
25
    /**
26
     * @param int $width
27
     * @param int $height
28
     * @param string $mime
29
     */
30
    public function __construct($width, $height, $mime)
31
    {
32
        $this->width = $width;
33
        $this->height = $height;
34
        $this->mime = $mime;
35
    }
36
37
    /**
38
     * @return int
39
     */
40
    public function getWidth()
41
    {
42
        return $this->width;
43
    }
44
45
    /**
46
     * @return int
47
     */
48
    public function getHeight()
49
    {
50
        return $this->height;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getMime()
57
    {
58
        return $this->mime;
59
    }
60
61
    /**
62
     * @return array
63
     */
64
    public function toArray()
65
    {
66
        return [
67
            'width' => $this->getWidth(),
68
            'height' => $this->getHeight(),
69
            'mime' => $this->getMime(),
70
        ];
71
    }
72
}
73