SimpleBusFileQueryBus::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the BenGorFile package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorFile\SimpleBusBridge\Application;
14
15
use Ajgl\SimpleBus\Message\Bus\CatchReturnMessageBus;
16
use BenGorFile\File\Infrastructure\Application\FileQueryBus;
17
18
/**
19
 * Simple bus implementation of file query bus.
20
 *
21
 * @author Beñat Espiña <[email protected]>
22
 */
23
class SimpleBusFileQueryBus implements FileQueryBus
24
{
25
    /**
26
     * The message bus.
27
     *
28
     * @var CatchReturnMessageBus
29
     */
30
    private $messageBus;
31
32
    /**
33
     * Constructor.
34
     *
35
     * @param CatchReturnMessageBus $aMessageBus The message bus
36
     */
37
    public function __construct(CatchReturnMessageBus $aMessageBus)
38
    {
39
        $this->messageBus = $aMessageBus;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function handle($query, &$result)
46
    {
47
        $this->messageBus->handle($query, $result);
48
    }
49
}
50