Barista   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 32
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A makeCoffee() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
namespace codenixsv\Patterns\Structural\Facade;
5
6
/**
7
 * Class Barista
8
 * @package codenixsv\Patterns\Structural\Facade
9
 */
10
class Barista
11
{
12
    /**
13
     * @var CoffeeGrinderInterface
14
     */
15
    private $coffeeGrinder;
16
17
    /**
18
     * @var CoffeeMachineInterface
19
     */
20
    private $coffeeMachine;
21
22
    /**
23
     * Barista constructor.
24
     * @param CoffeeGrinderInterface $coffeeGrinder
25
     * @param CoffeeMachineInterface $coffeeMachine
26
     */
27 1
    public function __construct(CoffeeGrinderInterface $coffeeGrinder, CoffeeMachineInterface $coffeeMachine)
28
    {
29 1
        $this->coffeeGrinder = $coffeeGrinder;
30 1
        $this->coffeeMachine = $coffeeMachine;
31 1
    }
32
33 1
    public function makeCoffee()
34
    {
35 1
        $this->coffeeGrinder->load();
36 1
        $this->coffeeGrinder->grind();
37
38 1
        $this->coffeeMachine->load();
39 1
        $this->coffeeMachine->make();
40 1
    }
41
}
42