Test Setup Failed
Push — master ( 4c62c0...259020 )
by Bruce Pinheiro de
02:12
created

CardClient::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 4
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace BPCI\SumUp\Customer\Card;
3
4
use BPCI\SumUp\ContextInterface;
5
use BPCI\SumUp\Customer\CustomerInterface;
6
use BPCI\SumUp\OAuth\AccessToken;
7
use Psr\Http\Message\ResponseInterface;
8
9
10
class CardClient implements CardClientInterface
11
{
12
13
    static function getScopes(): array {
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...
14
        return [
15
            'payment_instruments'
16
        ];
17
    }
18
19
	/**
20
	 * Retieve a card from server and fill the $card Object with response.
21
	 *
22
	 * @param CardInterface $card
23
	 * @param CustomerInterface $customer
24
	 * @param ContextInterface $context
25
	 * @param AccessToken $accessToken
26
	 * @return CardInterface
27
	 */
28
	public static function get(
29
		CardInterface $card,
30
		CustomerInterface $customer,
31
		ContextInterface $context,
32
		AccessToken $accessToken
33
	): CardInterface {
34
		// TODO: Implement get() method.
35
	}
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return BPCI\SumUp\Customer\Card\CardInterface. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
36
37
	/**
38
	 * Delete an card from server.
39
	 *
40
	 * @param CardInterface $card
41
	 * @param CustomerInterface $customer
42
	 * @param ContextInterface $context
43
	 * @param AccessToken $accessToken
44
	 * @return void
45
	 */
46
	public static function delete(
47
		CardInterface $card,
48
		CustomerInterface $customer,
49
		ContextInterface $context,
50
		AccessToken $accessToken
51
	): void {
52
		// TODO: Implement delete() method.
53
	}
54
55
	/**
56
	 * CheckoutClientInterface constructor.
57
	 * @param ContextInterface $context
58
	 */
59
	public function __construct(ContextInterface $context)
60
	{
61
		parent::__construct($context);
62
	}
63
64
	/**
65
	 * Return last response of client
66
	 * @return ResponseInterface
67
	 */
68
	function getLastResponse(): ResponseInterface
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...
69
	{
70
		// TODO: Implement getLastResponse() method.
71
	}
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Psr\Http\Message\ResponseInterface. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
72
73
	/**
74
	 * return the context used to created the client.
75
	 * @return ContextInterface
76
	 */
77
	function getContext(): ContextInterface
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...
78
	{
79
		// TODO: Implement getContext() method.
80
	}
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return BPCI\SumUp\ContextInterface. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
81
82
	/**
83
	 * Create a new card resource and fill the $card Object with response.
84
	 *
85
	 * @param CardInterface $card
86
	 * @param CustomerInterface $costumer
87
	 * @param ContextInterface $context
88
	 * @param AccessToken $accessToken
89
	 * @return CardInterface
90
	 */
91
	public static function create(
92
		CardInterface $card,
93
		CustomerInterface $costumer,
94
		ContextInterface $context,
95
		AccessToken $accessToken
96
	): CardInterface {
97
		// TODO: Implement create() method.
98
	}
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return BPCI\SumUp\Customer\Card\CardInterface. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
99
}
100