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

DataMeta   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 65
ccs 0
cts 26
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getWidth() 0 4 1
A getHeight() 0 4 1
A getMime() 0 4 1
A toArray() 0 8 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
    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