StaticWrapperTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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
    /**
8
     * @return int|string
9 3
     */
10
    public static function get(string $url)
11 3
    {
12 3
        $request = new Request($url);
13 3
        $request
14 3
            ->setDefaultGetOptions()
15
            ->setDefaultSpeedOptions()
16
            ->setNoFollowRedirection()
17 3
            ->setDesktopUserAgent()
18
        ;
19 3
20
        $response = $request->exec();
21
22
        return \is_int($response) ? $response : $response->getContent();
23
    }
24
}
25