Completed
Push — master ( 97fc71...726d4b )
by WEBEWEB
01:08
created

DepartementsRequest::getResourcePath()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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\Request\Region;
13
14
use WBW\Library\GeoAPI\Request\AbstractRequest;
15
16
/**
17
 * Départements request.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Library\GeoAPI\Request\Region
21
 */
22
class DepartementsRequest extends AbstractRequest {
23
24
    /**
25
     * Resource path.
26
     *
27
     * @avr string
28
     */
29
    const RESOURCE_PATH = "/regions/%s/departements";
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    public function getResourcePath(): string {
35
        if (null !== $this->getCode()) {
36
            return sprintf(self::RESOURCE_PATH, $this->getCode());
37
        }
38
        return self::RESOURCE_PATH;
39
    }
40
}