Completed
Push — master ( 67a91e...657487 )
by Peter
06:52
created

MiddlewareCommandBus   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 4 1
1
<?php
2
3
/**
4
 * GpsLab component.
5
 *
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/MIT
9
 */
10
11
namespace GpsLab\Component\Middleware\Command\Bus;
12
13
use GpsLab\Component\Command\Bus\CommandBus;
14
use GpsLab\Component\Command\Command;
15
use GpsLab\Component\Middleware\Chain\MiddlewareChain;
16
17
class MiddlewareCommandBus implements CommandBus
18
{
19
    /**
20
     * @var MiddlewareChain
21
     */
22
    private $chain;
23
24
    /**
25
     * @param MiddlewareChain $chain
26
     */
27
    public function __construct(MiddlewareChain $chain)
28
    {
29
        $this->chain = $chain;
30
    }
31
32
    /**
33
     * @param Command $command
34
     */
35
    public function handle(Command $command)
36
    {
37
        $this->chain->run($command);
38
    }
39
}
40