Completed
Push — master ( 18596e...6a2cea )
by Peter
05:00
created

DataMeta::mime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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