Completed
Push — master ( 2f8322...f18f78 )
by Gaël
11:24
created

LaPoste::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DansMaCulotte\LaPoste;
4
5
use GuzzleHttp\Client as HttpClient;
6
7
class LaPoste
8
{
9
    /** @var string */
10
    const API_URL = 'https://api.laposte.fr';
11
12
    /** @var HttpClient */
13
    public $httpClient;
14
15
    /**
16
     * Construct Method
17
     *
18
     * @param string $apiKey La Poste Developer API Key
19
     */
20
    public function __construct(string $apiKey)
21
    {
22
        $this->httpClient = new HttpClient(
23
            [
24
                'base_uri' =>  self::API_URL,
25
                'headers' => [
26
                    'X-Okapi-Key' => $apiKey,
27
                ],
28
            ]
29
        );
30
    }
31
}
32