Client   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 26
ccs 0
cts 13
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 18 2
1
<?php
2
3
namespace Dekalee\AdbackAnalytics\Client;
4
5
/**
6
 * Class Client
7
 */
8
class Client
9
{
10
    /**
11
     * @param $url
12
     *
13
     * @return Response
14
     */
15
    public function get($url)
16
    {
17
        if (function_exists('curl_version')) {
18
            $curl = curl_init($url);
19
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
20
            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
21
            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
22
            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
23
            $data = curl_exec($curl);
24
            curl_close($curl);
25
        } else {
26
            $data = @file_get_contents($url);
27
        }
28
29
        $response = new Response($data);
30
31
        return $response;
32
    }
33
}
34