JsonManifestLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
c 0
b 0
f 0
rs 10
ccs 4
cts 5
cp 0.8

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 10 2
1
<?php
2
3
namespace Rj\FrontendBundle\Manifest\Loader;
4
5
class JsonManifestLoader extends AbstractManifestLoader
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10 7
    protected function parse($path)
11
    {
12 7
        $entries = json_decode(file_get_contents($path), true);
13
14 7
        if (json_last_error() !== JSON_ERROR_NONE) {
15
            throw new \Exception("Failed to parse json manifest file ($path): ".json_last_error_msg());
16
        }
17
18 7
        return $entries;
19
    }
20
}
21