CommuneProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A communes() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the geo-api-library package.
5
 *
6
 * (c) 2020 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\GeoAPI\Provider;
13
14
use GuzzleHttp\Exception\GuzzleException;
15
use WBW\Library\Core\Exception\ApiException;
16
use WBW\Library\GeoAPI\Request\Commune\CommunesRequest;
17
use WBW\Library\GeoAPI\Response\CommunesResponse;
18
use WBW\Library\GeoAPI\Serializer\DecoupageAdministratifResponseDeserializer;
19
20
/**
21
 * Commune provider.
22
 *
23
 * @author webeweb <https://github.com/webeweb/>
24
 * @package WBW\Library\GeoAPI\Provider
25
 */
26
class CommuneProvider extends DecoupageAdministratifProvider {
27
28
    /**
29
     * Communes.
30
     *
31
     * @param CommunesRequest $request The communes request.
32
     * @return CommunesResponse Returns the communes response.
33
     * @throws GuzzleException Throws a Guzzle exception if an error occurs.
34
     * @throws ApiException Throws an API exception if an error occurs.
35
     */
36 5
    public function communes(CommunesRequest $request): CommunesResponse {
37
38 5
        $rawResponse = $this->callApi($request, []);
39
40 5
        return DecoupageAdministratifResponseDeserializer::deserializeCommunesResponse($rawResponse);
41
    }
42
}