Completed
Push — master ( f9505c...1786f5 )
by Wojciech
10s
created

ProviderCsvApiClient::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
/*
3
 * This file is part of the PayBreak/basket 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\CsvApiClient;
14
use Psr\Log\LoggerInterface;
15
16
/**
17
 * Class ProviderCsvApiClient
18
 *
19
 * @author EA
20
 * @package PayBreak\Sdk\ApiClient
21
 */
22 View Code Duplication
class ProviderCsvApiClient extends CsvApiClient
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
{
24
    /**
25
     * @author WN
26
     * @param string $baseUrl
27
     * @param string $token
28
     * @param LoggerInterface $logger
29
     * @return ProviderApiClient
30
     */
31
    public static function make($baseUrl, $token = '', LoggerInterface $logger = null)
32
    {
33
        $headers = [];
34
35
        if ($token != '') {
36
            $headers['Authorization'] = "ApiToken token=\"" . $token . "\"";
37
        }
38
39
        return new self(['base_uri' => $baseUrl], $logger, $headers);
40
    }
41
}
42