TextLoader   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A load() 0 9 2
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\loader;
13
14
use holyshared\fixture\FixtureLoader;
15
16
17
final class TextLoader implements FixtureLoader
18
{
19
20
    const NAME = 'text';
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function getName()
26
    {
27
        return static::NAME;
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function load($path, array $arguments = [])
34
    {
35
        if (file_exists($path) === false) {
36
            throw new FixtureFileNotFoundException($path);
37
        }
38
        $content = file_get_contents($path);
39
40
        return rtrim($content);
41
    }
42
43
}
44