TacticianMiddleWare   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provide() 0 5 1
A __construct() 0 4 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Application Use Case Class
5
 * @author Ticaje <[email protected]>
6
 */
7
8
namespace Ticaje\Hexagonal\Application\Implementors\UseCase\Bus;
9
10
use League\Tactician\CommandBus;
11
use Ticaje\Hexagonal\Application\Signatures\UseCase\ImplementorInterface;
12
13
class TacticianMiddleWare implements ImplementorInterface
14
{
15
    /** @var array $recipes */
16
    private $recipes;
17
18
    /**
19
     * TacticianMiddleWare constructor.
20
     *
21
     * @param array $recipes
22
     */
23
    public function __construct(
24
        array $recipes
25
    ) {
26
        $this->recipes = $recipes;
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function provide(array $machinery)
33
    {
34
        $result = new CommandBus($this->recipes);
35
36
        return $result;
37
    }
38
}
39