HttpClientServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Ps2alerts\Api\ServiceProvider;
4
5
use League\Container\ServiceProvider\AbstractServiceProvider;
6
use GuzzleHttp\Client;
7
8
class HttpClientServiceProvider extends AbstractServiceProvider
9
{
10
    /**
11
     * @var array
12
     */
13
    protected $provides = [
14
        'GuzzleHttp\Client'
15
    ];
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function register()
21
    {
22
        $this->getContainer()->add('GuzzleHttp\Client', function () {
23
            return new Client([
24
                'timeout' => 10.0
25
            ]);
26
        });
27
    }
28
}
29