Completed
Push — master ( ea522c...375169 )
by Korotkov
04:17
created

DesktopBuilder::getComputer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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
    /**
20
     * @var array
21
     */
22
    protected $params;
23
24
    /**
25
     * @param string $key
26
     * @param        $value
27
     * @return $this
28
     */
29
    public function addParam(string $key, $value): BuilderInterface
30
    {
31
        $this->params[$key] = $value;
32
33
        return $this;
34
    }
35
36
    /**
37
     * @return AbstractComputer
38
     */
39
    public function getComputer(): AbstractComputer
40
    {
41
        return new Desktop($this->params);
42
    }
43
}
44