MiddlewareQueryBus   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10

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\Query\Bus;
12
13
use GpsLab\Component\Middleware\Chain\MiddlewareChain;
14
use GpsLab\Component\Query\Bus\QueryBus;
15
use GpsLab\Component\Query\Query;
16
17
class MiddlewareQueryBus implements QueryBus
18
{
19
    /**
20
     * @var MiddlewareChain
21
     */
22
    private $chain;
23
24
    /**
25
     * @param MiddlewareChain $chain
26
     */
27 1
    public function __construct(MiddlewareChain $chain)
28
    {
29 1
        $this->chain = $chain;
30 1
    }
31
32
    /**
33
     * @param Query $query
34
     *
35
     * @return mixed
36
     */
37 1
    public function handle(Query $query)
38
    {
39 1
        return $this->chain->run($query);
40
    }
41
}
42