GuzzleClientFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
1
<?php
2
3
namespace KaLLoSz\Twig\Extension\Client;
4
5
use GuzzleHttp\Client;
6
use GuzzleHttp\ClientInterface;
7
use KaLLoSz\Twig\Extension\IframelyClientInterface;
8
9
/**
10
 * Class GuzzleClientFactory
11
 * @package KaLLoSz\Twig\Extension
12
 *
13
 * @author Patryk Kala <[email protected]>
14
 */
15
class GuzzleClientFactory
16
{
17
    /**
18
     * @param array $config
19
     *
20
     * @return ClientInterface
21
     */
22
    public static function create(array $config = []): ClientInterface
23
    {
24
        return new Client(array_merge($config, [
25
            'base_uri' => IframelyClientInterface::API_URI,
26
        ]));
27
    }
28
}
29