Client::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace DMT\VatServiceEu;
4
5
use DMT\VatServiceEu\Request\RequestInterface;
6
use DMT\VatServiceEu\Response\ResponseInterface;
7
use League\Tactician\CommandBus;
8
9
/**
10
 * Class Client
11
 *
12
 * Implementation on the VIES VAT validation service.
13
 *
14
 * {@link} http://ec.europa.eu/taxation_customs/vies/services/checkVatService?wsdl=checkVatPortType.wsdl
15
 */
16
class Client
17
{
18
    /**
19
     * @var CommandBus
20
     */
21
    protected $commandBus;
22
23
    /**
24
     * Client constructor.
25
     *
26
     * @param CommandBus $commandBus
27
     */
28 3
    public function __construct(CommandBus $commandBus)
29
    {
30 3
        $this->commandBus = $commandBus;
31
    }
32
33
    /**
34
     * Execute the request
35
     *
36
     * @param RequestInterface $request
37
     * @return ResponseInterface
38
     */
39 2
    public function execute(RequestInterface $request): ResponseInterface
40
    {
41 2
        return $this->commandBus->handle($request);
42
    }
43
}