Completed
Push — master ( d6f0bd...41a21b )
by Ivannis Suárez
05:43
created

DataSourceHashMap   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 8 2
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Cubiche\Core\Collections;
12
13
use Cubiche\Core\Collections\ArrayCollection\ArrayHashMap;
14
use Cubiche\Core\Collections\LazyCollection\LazyHashMap;
15
16
/**
17
 * Data Source HashMap.
18
 *
19
 * @author Karel Osorio Ramírez <[email protected]>
20
 * @author Ivannis Suárez Jerez <[email protected]>
21
 */
22
class DataSourceHashMap extends LazyHashMap
23
{
24
    use DataSourceCollectionTrait;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    protected function initialize()
30
    {
31
        $this->collection = new ArrayHashMap();
32
33
        foreach ($this->dataSource->getIterator() as $key => $value) {
34
            $this->collection->set($key, $value);
35
        }
36
    }
37
}
38