HasSize   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 66
ccs 14
cts 14
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A size() 0 6 1
A height() 0 5 1
A square() 0 6 1
A width() 0 5 1
1
<?php
2
3
namespace Limsum\UrlMakers;
4
5
trait HasSize
6
{
7
8
    /**
9
     * Image width.
10
     *
11
     * @var float
12
     */
13
    protected float $width;
14
15
    /**
16
     * Image height.
17
     *
18
     * @var float
19
     */
20
    protected float $height;
21
22
    /**
23
     * @param float $width
24
     *
25
     * @return static
26
     */
27 2
    public function width(float $width): static
28
    {
29 2
        $this->width = $width;
30
31 2
        return $this;
32
    }
33
34
    /**
35
     * @param float $height
36
     *
37
     * @return static
38
     */
39 1
    public function height(float $height): static
40
    {
41 1
        $this->height = $height;
42
43 1
        return $this;
44
    }
45
46
    /**
47
     * @param float $size
48
     *
49
     * @return static
50
     */
51 1
    public function square(float $size): static
52
    {
53 1
        $this->width  = $size;
54 1
        $this->height = $size;
55
56 1
        return $this;
57
    }
58
59
    /**
60
     * @param float $width
61
     * @param float $height
62
     *
63
     * @return static
64
     */
65 1
    public function size(float $width, float $height): static
66
    {
67 1
        $this->width  = $width;
68 1
        $this->height = $height;
69
70 1
        return $this;
71
    }
72
}
73