Passed
Push — main ( 191161...deb0a6 )
by Aron
02:36
created

Curl   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A curl() 0 9 1
1
<?php
2
3
namespace artes\Curl;
4
5
/**
6
  * A class for curl requests
7
  *
8
  * @SuppressWarnings(PHPMD)
9
  */
10
class Curl
11
{
12
    /**
13
     *
14
     * @param string $url
15
     *
16
     */
17
18 14
    public function curl($url)
19
    {
20 14
        $ch = curl_init();
21 14
        curl_setopt(/** @scrutinizer ignore-type */ $ch, CURLOPT_URL, $url);
22 14
        curl_setopt(/** @scrutinizer ignore-type */ $ch, CURLOPT_RETURNTRANSFER, 1);
23 14
        $apiresponse = curl_exec(/** @scrutinizer ignore-type */ $ch);
24
25 14
        $jsonresp = json_decode($apiresponse, /** @scrutinizer ignore-type */ JSON_UNESCAPED_UNICODE);
26 14
        return $jsonresp;
27
    }
28
}
29