Dummy   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 49
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getColor() 0 4 2
A fill() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ReliqArts\GuidedImage\Demand;
6
7
final class Dummy extends Image
8
{
9
    public const DEFAULT_COLOR = 'eefefe';
10
11
    /**
12
     * @var string
13
     */
14
    private $color;
15
16
    /**
17
     * @var mixed
18
     */
19
    private $filling;
20
21
    /**
22
     * Dummy constructor.
23
     *
24
     * @param mixed $width
25
     * @param mixed $height
26
     * @param mixed $color
27
     * @param mixed $filling
28
     * @param null  $returnObject
29
     */
30
    public function __construct(
31
        $width,
32
        $height,
33
        $color = null,
34
        $filling = null,
35
        $returnObject = null
36
    ) {
37
        parent::__construct($width, $height, $returnObject);
38
39
        $this->color = $color;
40
        $this->filling = $filling;
41
    }
42
43
    public function getColor(): string
44
    {
45
        return $this->isValueConsideredNull($this->color) ? self::DEFAULT_COLOR : $this->color;
46
    }
47
48
    /**
49
     * @return mixed
50
     */
51
    public function fill()
52
    {
53
        return $this->isValueConsideredNull($this->filling) ? null : $this->filling;
54
    }
55
}
56