Completed
Push — master ( 0a797c...b034af )
by Korotkov
03:59 queued 02:35
created

DesktopBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setParam() 0 5 1
A getComputer() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Korotkov Danila <[email protected]>
7
 * @license   https://mit-license.org/ MIT
8
 */
9
10
namespace Creational\Builder;
11
12
/**
13
 * Class ComputerBuilder
14
 * @package Creational\Builder
15
 */
16
class DesktopBuilder implements BuilderInterface
17
{
18
    /**
19
     * @var array
20
     */
21
    private $params;
22
23
    /**
24
     * @param string $key
25
     * @param        $value
26
     * @return $this
27
     */
28
    public function setParam(string $key, $value): BuilderInterface
29
    {
30
        $this->params[$key] = $value;
31
32
        return $this;
33
    }
34
35
    /**
36
     * @return AbstractComputer
37
     */
38
    public function getComputer(): AbstractComputer
39
    {
40
        return new Desktop($this->params);
41
    }
42
}
43