SumUp::getEntrypoint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BPCI\SumUp;
4
5
use GuzzleHttp\Client;
6
use GuzzleHttp\ClientInterface;
7
8
class SumUp
9
{
10
	const VERSION = 'v0.1';
11
	const ENTRYPOINT = 'https://api.sumup.com/';
12
13
	/**
14
     * @param array $options
15
     * @return ClientInterface
16
	 */
17 6
    static function getClient(array $options = []): ClientInterface
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
18
	{
19 6
        $options = array_merge_recursive(
20
			[
21 6
				'base_uri' => self::getEntrypoint(),
22 6
				'timeout' => 2
23
            ],
24 6
            $options
25
		);
26
27 6
        return new Client($options);
28
	}
29
30 7
	static function getEntrypoint(): string
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
31
	{
32 7
		return self::ENTRYPOINT.self::VERSION.'/';
33
	}
34
}
35
36