Total Complexity | 7 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
12 | final class NotImplementedSubscriberGateway implements SubscriberGateway |
||
13 | { |
||
14 | public function exists(string $email, string $listId = null): bool |
||
17 | } |
||
18 | |||
19 | public function getInterests(string $listId = null): array |
||
20 | { |
||
21 | $this->throwException(); |
||
22 | } |
||
23 | |||
24 | public function hasStatus(string $email, ?string $listId, string $status): bool |
||
25 | { |
||
26 | $this->throwException(); |
||
27 | } |
||
28 | |||
29 | public function ping(string $listId = null): bool |
||
30 | { |
||
31 | $this->throwException(); |
||
32 | } |
||
33 | |||
34 | public function subscribe( |
||
35 | string $email, |
||
36 | string $listId = null, |
||
37 | string $language = null, |
||
38 | array $mergeFields = array(), |
||
39 | array $interests = array(), |
||
40 | bool $doubleOptin = true |
||
41 | ): bool { |
||
42 | $this->throwException(); |
||
43 | } |
||
44 | |||
45 | public function unsubscribe( |
||
46 | string $email, |
||
47 | string $listId = null |
||
48 | ): bool { |
||
49 | $this->throwException(); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @throws NotImplementedException |
||
54 | */ |
||
55 | private function throwException(): void |
||
58 | } |
||
59 | } |
||
60 |
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: