Completed
Push — master ( b9df90...42ec0b )
by John
01:59
created

LookupResponse::getAsResponseData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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