Completed
Pull Request — master (#6)
by Korotkov
02:44
created

DesktopBuilder::setParam()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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