GuzzleClientBuilder::getPackageName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of the feed-io package.
4
 *
5
 * (c) Alexandre Debril <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace FeedIo\Factory\Builder;
12
13
use FeedIo\Adapter\ClientInterface;
14
use FeedIo\Factory\ClientBuilderInterface;
15
use \FeedIo\Adapter\Guzzle\Client;
16
use \GuzzleHttp\Client as GuzzleClient;
17
18
/**
19
 * @package FeedIo
20
 */
21
class GuzzleClientBuilder implements ClientBuilderInterface
22
{
23
    /**
24
     * @var array
25
     */
26
    private $config = [];
27
28
    /**
29
     * @param array $config
30
     */
31 7
    public function __construct(array $config = [])
32
    {
33 7
        $this->config = $config;
34 7
    }
35
36
    /**
37
     * This method MUST return a \FeedIo\Adapter\ClientInterface instance
38
     * @return \FeedIo\Adapter\ClientInterface
39
     */
40 3
    public function getClient() : ClientInterface
41
    {
42 3
        return new Client(new GuzzleClient($this->config));
43
    }
44
 
45
    /**
46
     * This method MUST return the name of the main class
47
     * @return string
48
     */
49 1
    public function getMainClassName() : string
50
    {
51 1
        return '\GuzzleHttp\Client';
52
    }
53
    
54
    /**
55
     * This method MUST return the name of the package name
56
     * @return string
57
     */
58 1
    public function getPackageName() : string
59
    {
60 1
        return 'guzzlehttp/guzzle';
61
    }
62
}
63