PostCode::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Suilven\UKPostCodes\Models;
4
5
use _HumbugBox7c6aed0dbb3c\Roave\BetterReflection\Reflection\Adapter\ReflectionObject;
6
7
/**
8
 * Class PostCode
9
 * @package Suilven\UKPostCodes\Models
10
 *
11
 * * @property int $admin_county
12
* @property int $admin_district
13
* @property int $admin_ward
14
* @property int $ccg
15
* @property int $ced
16
* @property int $codes
17
* @property int $country
18
* @property int $eastings
19
* @property int $european_electoral_region
20
* @property int $incode
21
* @property int $latitude
22
* @property int $longitude
23
* @property int $lsoa
24
* @property int $msoa
25
* @property int $nhs_ha
26
* @property int $northings
27
* @property int $nuts
28
* @property int $outcode
29
* @property int $parish
30
* @property int $parliamentary_constituency
31
* @property int $postcode
32
* @property int $primary_care_trust
33
* @property int $quality
34
* @property int $region
35
36
 */
37
class PostCode
38
{
39
    public function __construct($response)
40
    {
41
        $keys = array_keys($response);
42
        sort($keys);
43
        foreach ($keys as $key) {
44
            //error_log('* @property int $' . $key);
45
            $this->$key = $response[$key];
46
        }
47
    }
48
}
49