Completed
Push — master ( f55937...6ea988 )
by Eric
06:30
created

Set::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Oqq\Minc\Common\Collection;
4
5
/**
6
 * @author Eric Braun <[email protected]>
7
 */
8
class Set extends AbstractCollection
9
{
10
    /**
11
     * @param array $values
12
     */
13
    public function __construct($values)
14
    {
15
        parent::__construct(array_fill_keys($values, true));
16
    }
17
18
    /**
19
     * @inheritdoc
20
     */
21
    public function contains($value)
22
    {
23
        return $this->containsKey($value);
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function get($key)
30
    {
31
        $this->assertContainsKey($key);
32
33
        return $key;
34
    }
35
}
36