Transporter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 10 1
1
<?php
2
3
/**
4
 * This file is part of Laravel Meetups.
5
 *
6
 * (c) Nuno Maduro <[email protected]>
7
 *
8
 *  For the full copyright and license information, please view the LICENSE
9
 *  file that was distributed with this source code.
10
 */
11
12
namespace LaravelMeetups\Http\Client;
13
14
use LaravelMeetups\Contracts\Http\Client\Query as QueryContract;
15
use LaravelMeetups\Contracts\Http\Client\Transporter as Contract;
16
17
/**
18
 * Class Transporter.
19
 */
20
class Transporter implements Contract
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function execute(QueryContract $query)
26
    {
27
        $ch = curl_init();
28
        curl_setopt($ch, CURLOPT_URL, $query->toString());
29
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
30
        $response = curl_exec($ch);
31
        curl_close($ch);
32
33
        return $response;
34
    }
35
}
36