Client   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 26
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A execute() 0 3 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
}