HolidayLoader   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleRawData() 0 8 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\Holiday;
12
13
use China\Common\ResourceLoader\LazyLoader;
14
15
class HolidayLoader extends LazyLoader
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function handleRawData($data)
21
    {
22
        return array_map(function($holidayData){
23
            $date = explode('月', trim($holidayData['date'], '日'));
24
25
            return new Holiday($holidayData['name'], $holidayData['type'], new Date($date[0], $date[1]));
26
        }, $data);
27
    }
28
}