Completed
Push — master ( 5927eb...1e13db )
by
unknown
04:04
created

FileLoader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 8 2
1
<?php
2
3
namespace League\JsonGuard\Loaders;
4
5
use League\JsonGuard;
6
use League\JsonGuard\Exceptions\SchemaLoadingException;
7
use League\JsonGuard\Loader;
8
9
class FileLoader implements Loader
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14 12
    public function load($path)
15
    {
16 12
        if (!file_exists($path)) {
17 2
            throw SchemaLoadingException::notFound($path);
18
        }
19
20 10
        return JsonGuard\json_decode(file_get_contents($path));
21
    }
22
}
23