IronChair::hasLegs()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace codenixsv\Patterns\Creational\AbstractFactory;
5
6
/**
7
 * Class IronChair
8
 * @package codenixsv\Patterns\Creational\AbstractFactory
9
 */
10 View Code Duplication
class IronChair implements ChairInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @var string
14
     */
15
    private $color;
16
17
    /**
18
     * @var bool
19
     */
20
    private $hasLegs;
21
22
    /**
23
     * WoodenChair constructor.
24
     * @param string $color
25
     * @param bool $hasLegs
26
     */
27 1
    public function __construct(string $color, bool $hasLegs)
28
    {
29 1
        $this->color = $color;
30 1
        $this->hasLegs = $hasLegs;
31 1
    }
32
33
    /**
34
     * @return string
35
     */
36 1
    public function getColor(): string
37
    {
38 1
        return $this->color;
39
    }
40
41
    /**
42
     * @return bool
43
     */
44
    public function hasLegs(): bool
45
    {
46
        return $this->hasLegs;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 1
    public function getMaterial(): string
53
    {
54 1
        return 'iron';
55
    }
56
}
57