Directions   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A directions() 0 8 1
1
<?php
2
3
namespace kalanis\google_maps\Services;
4
5
6
use Psr\Http\Message\RequestInterface;
7
8
9
/**
10
 * Directions Service
11
 *
12
 * @see     https://developers.google.com/maps/documentation/directions/
13
 * @see     https://developers.google.com/maps/documentation/directions/get-directions
14
 */
15
class Directions extends AbstractService
16
{
17
    /**
18
     * Directions
19
     *
20
     * @param string $origin
21
     * @param string $destination
22
     * @param array<string, string|int|float> $params Query parameters
23
     * @return RequestInterface
24
     */
25 7
    public function directions(string $origin, string $destination, array $params = []): RequestInterface
26
    {
27 7
        $params['origin'] = $origin;
28 7
        $params['destination'] = $destination;
29
30 7
        return $this->getWithDefaults(
31 7
            static::API_HOST . '/maps/api/directions/json',
32 7
            $this->queryParamsLang($params)
33 7
        );
34
    }
35
}
36