SumUp   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 25
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getClient() 0 11 1
A getEntrypoint() 0 3 1
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