Completed
Push — master ( aa5ce4...36fc85 )
by Viacheslav
10s
created

BasicFetcher::getSchemaData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 2
nc 2
nop 1
crap 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
}