Completed
Push — master ( 66817c...5dccbe )
by Peter
02:23
created

DataMeta::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
crap 1
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 2
    public function __construct($width, $height, $mime)
31
    {
32 2
        $this->width = $width;
33 2
        $this->height = $height;
34 2
        $this->mime = $mime;
35 2
    }
36
37
    /**
38
     * @return int
39
     */
40 2
    public function getWidth()
41
    {
42 2
        return $this->width;
43
    }
44
45
    /**
46
     * @return int
47
     */
48 2
    public function getHeight()
49
    {
50 2
        return $this->height;
51
    }
52
53
    /**
54
     * @return string
55
     */
56 2
    public function getMime()
57
    {
58 2
        return $this->mime;
59
    }
60
61
    /**
62
     * @return array
63
     */
64 1
    public function toArray()
65
    {
66
        return [
67 1
            'width' => $this->getWidth(),
68 1
            'height' => $this->getHeight(),
69 1
            'mime' => $this->getMime(),
70 1
        ];
71
    }
72
}
73