Completed
Push — master ( 0f6ac6...c701d2 )
by WEBEWEB
01:05
created

CommunesRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResourcePath() 0 6 2
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\Model\Request\Region;
13
14
use WBW\Library\GeoAPI\Model\AbstractRequest;
15
use WBW\Library\GeoAPI\Model\Attribute\StringCodeTrait;
16
17
/**
18
 * Communes request.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Library\GeoAPI\Model\Request\Region
22
 */
23
class CommunesRequest extends AbstractRequest {
24
25
    use StringCodeTrait;
26
27
    /**
28
     * Resource path.
29
     *
30
     * @avr string
31
     */
32
    const RESOURCE_PATH = "/regions/%s/communes";
33
34
    /**
35
     * {@inheritDoc}
36
     */
37
    public function getResourcePath() {
38
        if (null !== $this->getCode()) {
39
            return sprintf(self::RESOURCE_PATH, $this->getCode());
40
        }
41
        return self::RESOURCE_PATH;
42
    }
43
}