FloatYTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getY() 0 3 1
A getYInt() 0 3 1
A setY() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2020 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\Model\Attribute;
13
14
/**
15
 * Float y trait.
16
 *
17
 * @author webeweb <https://github.com/webeweb/>
18
 * @package WBW\Library\Core\Model\Attribute
19
 */
20
trait FloatYTrait {
21
22
    /**
23
     * Y.
24
     *
25
     * @var float|null
26
     */
27
    protected $y;
28
29
    /**
30
     * Get the y.
31
     *
32
     * @return float|null Returns the y.
33
     */
34
    public function getY(): ?float {
35
        return $this->y;
36
    }
37
38
    /**
39
     * Get the (int) y.
40
     *
41
     * @return int Returns the y.
42
     */
43
    public function getYInt(): int {
44
        return intval($this->y);
45
    }
46
47
    /**
48
     * Set the y.
49
     *
50
     * @param float|null $y The y.
51
     * @return self Returns this instance.
52
     */
53
    public function setY(?float $y): self {
54
        $this->y = $y;
55
        return $this;
56
    }
57
}
58