StaticWrapperTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 15
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 13 2
1
<?php
2
3
namespace PiedWeb\Curl;
4
5
trait StaticWrapperTrait
6
{
7 3
    public static function get(string $url)
8
    {
9 3
        $request = new Request($url);
10
        $request
11 3
            ->setDefaultGetOptions()
12 3
            ->setDefaultSpeedOptions()
13 3
            ->setNoFollowRedirection()
14 3
            ->setDesktopUserAgent()
15
        ;
16
17 3
        $response = $request->exec();
18
19 3
        return is_int($response) ? $response : $response->getContent();
20
    }
21
}
22