1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace AtlassianConnectBundle\Tests\Security; |
6
|
|
|
|
7
|
|
|
use AtlassianConnectBundle\Entity\TenantInterface; |
8
|
|
|
use Symfony\Component\Security\Core\Role\Role; |
9
|
|
|
|
10
|
|
|
class StubbedTenant implements TenantInterface |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @return array<string>|array<Role> |
14
|
|
|
*/ |
15
|
|
|
public function getRoles(): array |
16
|
|
|
{ |
17
|
|
|
return ['ROLE_USER']; |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
public function getSharedSecret(): ?string |
21
|
|
|
{ |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function getOauthClientId(): ?string |
25
|
|
|
{ |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function getBaseUrl(): ?string |
29
|
|
|
{ |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function getAddonKey(): ?string |
33
|
|
|
{ |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function setUsername(string $name): TenantInterface |
37
|
|
|
{ |
38
|
|
|
} |
|
|
|
|
39
|
|
|
|
40
|
|
|
public function setAddonKey(string $addonKey): TenantInterface |
41
|
|
|
{ |
42
|
|
|
} |
|
|
|
|
43
|
|
|
|
44
|
|
|
public function setClientKey(string $clientKey): TenantInterface |
45
|
|
|
{ |
46
|
|
|
} |
|
|
|
|
47
|
|
|
|
48
|
|
|
public function setPublicKey(string $publicKey): TenantInterface |
49
|
|
|
{ |
50
|
|
|
} |
|
|
|
|
51
|
|
|
|
52
|
|
|
public function setSharedSecret(string $sharedSecret): TenantInterface |
53
|
|
|
{ |
54
|
|
|
} |
|
|
|
|
55
|
|
|
|
56
|
|
|
public function setServerVersion(string $serverVersion): TenantInterface |
57
|
|
|
{ |
58
|
|
|
} |
|
|
|
|
59
|
|
|
|
60
|
|
|
public function setPluginsVersion(string $pluginsVersion): TenantInterface |
61
|
|
|
{ |
62
|
|
|
} |
|
|
|
|
63
|
|
|
|
64
|
|
|
public function setBaseUrl(string $baseUrl): TenantInterface |
65
|
|
|
{ |
66
|
|
|
} |
|
|
|
|
67
|
|
|
|
68
|
|
|
public function setProductType(string $productType): TenantInterface |
69
|
|
|
{ |
70
|
|
|
} |
|
|
|
|
71
|
|
|
|
72
|
|
|
public function setDescription(string $description): TenantInterface |
73
|
|
|
{ |
74
|
|
|
} |
|
|
|
|
75
|
|
|
|
76
|
|
|
public function setEventType(string $eventType): TenantInterface |
77
|
|
|
{ |
78
|
|
|
} |
|
|
|
|
79
|
|
|
|
80
|
|
|
public function setOauthClientId(?string $oauthClientId): TenantInterface |
81
|
|
|
{ |
82
|
|
|
} |
|
|
|
|
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @return string|void |
86
|
|
|
*/ |
87
|
|
|
public function getPassword(): ?string |
88
|
|
|
{ |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
public function getSalt(): ?string |
92
|
|
|
{ |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function getUsername(): ?string |
96
|
|
|
{ |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
public function getUserIdentifier(): string |
100
|
|
|
{ |
101
|
|
|
return 'tenant'; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
public function eraseCredentials(): void |
105
|
|
|
{ |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
public function getClientKey(): ?string |
109
|
|
|
{ |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
public function isWhiteListed(): bool |
113
|
|
|
{ |
114
|
|
|
} |
|
|
|
|
115
|
|
|
} |
116
|
|
|
|
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: