Completed
Push — master ( 25f365...554d02 )
by Alexey
02:46
created

Leaf::getHeight()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Reflection\Tests\Dummy;
6
7
use \JsonSerializable as Serializable;
8
9
/**
10
 * Class Leaf
11
 * @package Reflection\Tests\Dummy
12
 */
13
class Leaf implements Serializable {
14
15
    /**
16
     * @var double
17
     */
18
    private $height;
19
20
    /**
21
     * @var double
22
     */
23
    private $width;
24
25
    /**
26
     * @return float
27
     */
28
    public function getHeight() {
29
        return $this->height;
30
    }
31
32
    /**
33
     * @param float $height
34
     * @return $this
35
     */
36
    public function setHeight($height) {
37
        $this->height = $height;
38
39
        return $this;
40
    }
41
42
    /**
43
     * @return float
44
     */
45
    public function getWidth() {
46
        return $this->width;
47
    }
48
49
    /**
50
     * @param float $width
51
     * @return $this
52
     */
53
    public function setWidth($width) {
54
        $this->width = $width;
55
56
        return $this;
57
    }
58
59
    /**
60
     * @param double $height
61
     * @param double $width
62
     */
63
    public function __construct($height = null, $width = null) {
64
        $this->height = $height;
65
        $this->width = $width;
66
    }
67
68
    /**
69
     * @return array
70
     */
71
    public function jsonSerialize() {
72
        return [
73
            'height' => $this->getHeight(),
74
            'width' => $this->getWidth()
75
        ];
76
    }
77
78
}