LazyHashMap   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 6 1
A containsKey() 0 6 1
A removeAt() 0 6 1
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\LazyCollection;
12
13
use Cubiche\Core\Collections\HashMapInterface;
14
15
/**
16
 * Lazy HashMap.
17
 *
18
 * @method HashMapInterface collection()
19
 *
20
 * @author Ivannis Suárez Jerez <[email protected]>
21
 * @author Karel Osorio Ramírez <[email protected]>
22
 */
23
abstract class LazyHashMap extends LazyCollection implements HashMapInterface
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function set($key, $value)
29
    {
30
        $this->lazyInitialize();
31
32
        $this->collection()->set($key, $value);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function containsKey($key)
39
    {
40
        $this->lazyInitialize();
41
42
        return $this->collection()->containsKey($key);
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function removeAt($key)
49
    {
50
        $this->lazyInitialize();
51
52
        return $this->collection()->removeAt($key);
53
    }
54
}
55