FixtureContainer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get() 0 4 1
A has() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of file-fixture.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace holyshared\fixture\container;
13
14
15
use Collections\Map;
16
use holyshared\fixture\Container;
17
18
19
final class FixtureContainer implements Container
20
{
21
22
    /**
23
     * @var \Collections\Map
24
     */
25
    private $fixtures;
26
27
    /**
28
     * @param array $fixtures
29
     */
30
    public function __construct(array $fixtures = [])
31
    {
32
        $this->fixtures = Map::fromArray($fixtures);
33
    }
34
35
    /**
36
     * Get the path of fixture file
37
     *
38
     * @param string $name
39
     * @return string
40
     */
41
    public function get($name)
42
    {
43
        return $this->fixtures->get($name);
44
    }
45
46
    /**
47
     * @param string $name
48
     * @return bool
49
     */
50
    public function has($name)
51
    {
52
        return $this->fixtures->containsKey($name);
53
    }
54
55
}
56