FileFixtureScope   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A loadFixture() 0 4 1
A fixturePath() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of file-fixture-plugin.
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\peridot;
13
14
use holyshared\fixture\FileFixture;
15
use Peridot\Core\Scope;
16
17
18
final class FileFixtureScope extends Scope
19
{
20
21
    /**
22
     * @var \holyshared\fixture\FileFixture
23
     */
24
    private $loader;
25
26
    /**
27
     * @param \holyshared\fixture\FileFixture $loader
28
     */
29
    public function __construct(FileFixture $loader)
30
    {
31
        $this->loader = $loader;
32
    }
33
34
    /**
35
     * Load the fixture file content by name
36
     *
37
     * @param string $name
38
     * @param array $arguments
39
     * @return string content of fixture
40
     */
41
    public function loadFixture($name, array $arguments = [])
42
    {
43
        return $this->loader->load($name, $arguments);
44
    }
45
46
    /**
47
     * Get the Path from the name of the fixture
48
     *
49
     * @param string $name
50
     * @return string the path of fixture
51
     */
52
    public function fixturePath($name)
53
    {
54
        return $this->loader->resolveName($name);
55
    }
56
57
}
58