ProviderApiClient   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 9 2
1
<?php
2
/*
3
 * This file is part of the PayBreak/paybreak-sdk-php package.
4
 *
5
 * (c) PayBreak <[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 PayBreak\Sdk\ApiClient;
12
13
use PayBreak\ApiClient\ApiClient;
14
use Psr\Log\LoggerInterface;
15
16
/**
17
 * Class ProviderApiClient
18
 *
19
 * @author WN
20
 * @package PayBreak\Sdk\ApiClient
21
 */
22
class ProviderApiClient extends ApiClient
23
{
24
    /**
25
     * @author WN
26
     * @param string $baseUrl
27
     * @param string $token
28
     * @param LoggerInterface $logger
29
     * @return ProviderApiClient
30
     */
31 8
    public static function make($baseUrl, $token = '', LoggerInterface $logger = null)
32
    {
33 8
        $headers = [];
34
35 8
        if ($token != '') {
36 8
            $headers['Authorization'] = "ApiToken token=\"" . $token . "\"";
37 8
        }
38
39 8
        return new self(['base_uri' => $baseUrl], $logger, $headers);
40
    }
41
}
42