Completed
Pull Request — master (#4)
by ARCANEDEV
06:24
created

DirectionsResponse::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 2
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace Arcanedev\GeoLocation\Google\Directions;
2
3
use Arcanedev\GeoLocation\Google\AbstractResponse;
4
5
/**
6
 * Class     DirectionsResponse
7
 *
8
 * @package  Arcanedev\GeoLocation\Google\Directions
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class DirectionsResponse extends AbstractResponse
12
{
13
    /* -----------------------------------------------------------------
14
     |  Properties
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * The routes collection.
20
     *
21
     * @var \Arcanedev\GeoLocation\Google\Directions\Entities\RouteCollection
22
     */
23
    protected $routes;
24
25
    /* -----------------------------------------------------------------
26
     |  Getters & Setters
27
     | -----------------------------------------------------------------
28
     */
29
30
    /**
31
     * Get the routes.
32
     *
33
     * @return \Arcanedev\GeoLocation\Google\Directions\Entities\RouteCollection
34
     */
35 3
    public function getRoutes()
36
    {
37 3
        if (is_null($this->routes)) {
38 3
            $this->routes = Entities\RouteCollection::load(
39 3
                $this->get('routes', [])
40 1
            );
41 1
        }
42
43 3
        return $this->routes;
44
    }
45
46
    /* -----------------------------------------------------------------
47
     |  Main Methods
48
     | -----------------------------------------------------------------
49
     */
50
51
    /**
52
     * Get the instance as an array.
53
     *
54
     * @return array
55
     */
56
    public function toArray()
57
    {
58
        return [
59
            //
60
        ];
61
    }
62
}
63