Completed
Push — master ( ba0dc9...449151 )
by John
01:49
created

LookupResponse::getAsAssociativeArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
namespace GeoPhone\Models;
3
4
use LunixREST\Response\ResponseData;
5
6
/**
7
* Class GeoPhone
8
* @package GeoPhone\Models
9
*/
10
class LookupResponse implements ResponseData {
11
    protected $city;
12
    protected $state;
13
14
    /**
15
     * LookupResponse constructor.
16
     * @param string $city
17
     * @param string $state
18
     */
19
    public function __construct(string $city, string $state) {
20
        $this->city = $city;
21
        $this->state = $state;
22
    }
23
24
25
    /**
26
     * @return array
27
     */
28
    public function getAsAssociativeArray(): array {
29
        return [
30
            "location" => [
31
                    'city' => $this->city,
32
                    'state' => $this->state
33
                ]
34
            ];
35
    }
36
}
37