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

Client::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
ccs 0
cts 10
cp 0
rs 9.4285
cc 1
eloc 8
nc 1
nop 1
crap 2
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