RegionLoader::handleRawData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
/*
3
 * This file is part of the Slince/China package.
4
 *
5
 * (c) Slince <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace China\Region;
12
13
use China\Common\ResourceLoader\LazyLoader;
14
use China\Region\Location\AddressInterface;
15
16
class RegionLoader extends LazyLoader
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function handleRawData($data)
22
    {
23
        $rootData = [
24
            'type' => AddressInterface::TYPE_PROVINCE,
25
            'name' => 'China',
26
            'code' => 0,
27
            'children' => $data,
28
        ];
29
30
        return [AddressFactory::createFromArray($rootData)];
31
    }
32
}