Completed
Push — master ( 7383a6...06d9f7 )
by ARCANEDEV
19s
created

Client   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 13 1
1
<?php namespace Arcanedev\Currencies\Http;
2
3
use Arcanedev\Currencies\Contracts\Http\Client as ClientInterface;
4
5
/**
6
 * Class     Client
7
 *
8
 * @package  Arcanedev\Currencies\Http
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class Client implements ClientInterface
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Main Functions
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Make a get request.
19
     *
20
     * @param  string  $url
21
     *
22
     * @return string
23
     */
24
    public function get($url)
25
    {
26
        $ch = curl_init();
27
28
        curl_setopt($ch, CURLOPT_URL, $url);
29
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
30
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
31
32
        $data = curl_exec($ch);
33
        curl_close($ch);
34
35
        return $data;
36
    }
37
}
38