ClientFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 13
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 11 2
1
<?php
2
3
namespace EasyHttp\SymfonyLayer\Factories;
4
5
use Symfony\Component\HttpClient\CurlHttpClient as SymfonyClient;
6
use Symfony\Component\HttpClient\MockHttpClient;
7
8
class ClientFactory
9
{
10 5
    public static function build($handler = null)
11
    {
12 5
        $instance = null;
13
14 5
        if ($handler) {
15 5
            $instance = new MockHttpClient($handler);
16
        } else {
17
            $instance = new SymfonyClient();
18
        }
19
20 5
        return $instance;
21
    }
22
}
23