Passed
Pull Request — master (#47)
by Viacheslav
02:59
created

BasicFetcher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 8
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSchemaData() 0 6 2
1
<?php
2
3
namespace Swaggest\JsonSchema\RemoteRef;
4
5
use Swaggest\JsonSchema\RemoteRefProvider;
6
7
class BasicFetcher implements RemoteRefProvider
8
{
9 4
    public function getSchemaData($url)
10
    {
11 4
        if (strtolower(substr($url, 0, 7)) === 'file://') {
12 3
            $url = substr($url, 7);
13
        }
14 4
        return json_decode(file_get_contents($url));
15
    }
16
}