Booking   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
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 28
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A query() 0 6 1
1
<?php
2
3
namespace DJStarCOM\BookingComSDK;
4
5
use DJStarCOM\BookingComSDK\HttpClient\HttpClientInterface;
6
use DJStarCOM\BookingComSDK\Models\Result;
7
use DJStarCOM\BookingComSDK\Query\Query;
8
9
/**
10
 * Class Booking
11
 * @package DJStarCOM\BookingComSDK
12
 */
13
class Booking
14
{
15
    /**
16
     * @var HttpClientInterface
17
     */
18
    private $httpClient;
19
20
    /**
21
     * Booking constructor.
22
     * @param HttpClientInterface $httpClient
23
     */
24
    public function __construct(HttpClientInterface $httpClient)
25
    {
26
        $this->httpClient = $httpClient;
27
    }
28
29
    /**
30
     * @param Query $query
31
     * @return Result
32
     * @throws Exceptions\BookingResponseException
33
     */
34
    public function query(Query $query): Result
35
    {
36
        $client = clone $this->httpClient;
37
38
        return $query->execute($client);
39
    }
40
}
41