BasicFetcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 5
b 0
f 0
dl 0
loc 15
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSchemaData() 0 13 2
1
<?php
2
3
namespace Swaggest\JsonSchema\RemoteRef;
4
5
use Swaggest\JsonSchema\RemoteRefProvider;
6
7
class BasicFetcher implements RemoteRefProvider
8
{
9 7
    public function getSchemaData($url)
10
    {
11 7
        $arrContextOptions = [
12
            "ssl" => [
13
                "verify_peer" => false,
14
                "verify_peer_name" => false,
15
            ],
16
        ];
17
18
        if ($data = file_get_contents(rawurldecode($url), false, stream_context_create($arrContextOptions))) {
19
            return json_decode($data);
20
        }
21
        return false;
22
    }
23
}