HttpClientFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 85.71%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 22
ccs 6
cts 7
cp 0.8571
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getHttpClient() 0 11 2
1
<?php
2
/**
3
 * @package: marx/php-self-updater
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2015-12-27
7
 *
8
 */
9
10
11
namespace PSU\HttpClient;
12
13
14
use GuzzleHttp\Client;
15
use PSU\HttpClient\Adapter\GuzzlApapter;
16
17
class HttpClientFactory
18
{
19
    /**
20
     * @var HttpClientInterface
21
     */
22
    private static $httpClient;
23
24
    /**
25
     * @return HttpClientInterface
26
     */
27 1
    public function getHttpClient()
28
    {
29 1
        if (self::$httpClient)
30 1
        {
31
            return self::$httpClient;
32
        }
33
34 1
        return self::$httpClient = new GuzzlApapter(
35 1
            new Client()
36 1
        );
37
    }
38
}