1 | <?php |
||
28 | class Client implements ResourceOwner, \JsonSerializable |
||
|
|||
29 | { |
||
30 | /** |
||
31 | * @var bool |
||
32 | */ |
||
33 | private $deleted = false; |
||
34 | |||
35 | /** |
||
36 | * @var UserAccountId|null |
||
37 | */ |
||
38 | private $ownerId = null; |
||
39 | |||
40 | /** |
||
41 | * @var ClientId|null |
||
42 | */ |
||
43 | private $clientId = null; |
||
44 | |||
45 | /** |
||
46 | * @var DataBag |
||
47 | */ |
||
48 | protected $parameters; |
||
49 | |||
50 | /** |
||
51 | * ClientCredentials constructor. |
||
52 | */ |
||
53 | private function __construct() |
||
57 | |||
58 | /** |
||
59 | * @return Client |
||
60 | */ |
||
61 | public static function createEmpty(): self |
||
65 | |||
66 | /** |
||
67 | * @param ClientId $clientId |
||
68 | * @param DataBag $parameters |
||
69 | * @param UserAccountId|null $ownerId |
||
70 | * |
||
71 | * @return Client |
||
72 | */ |
||
73 | public function create(ClientId $clientId, DataBag $parameters, ? UserAccountId $ownerId): self |
||
82 | |||
83 | /** |
||
84 | * @return UserAccountId|null |
||
85 | */ |
||
86 | public function getOwnerId(): ? UserAccountId |
||
90 | |||
91 | /** |
||
92 | * @param UserAccountId $ownerId |
||
93 | * |
||
94 | * @return Client |
||
95 | */ |
||
96 | public function withOwnerId(UserAccountId $ownerId): self |
||
107 | |||
108 | /** |
||
109 | * @param DataBag $parameters |
||
110 | * |
||
111 | * @return Client |
||
112 | */ |
||
113 | public function withParameters(DataBag $parameters): self |
||
120 | |||
121 | /** |
||
122 | * @return Client |
||
123 | */ |
||
124 | public function markAsDeleted(): self |
||
131 | |||
132 | /** |
||
133 | * @return bool |
||
134 | */ |
||
135 | public function isDeleted(): bool |
||
139 | |||
140 | /** |
||
141 | * @param string $grant_type |
||
142 | * |
||
143 | * @return bool |
||
144 | */ |
||
145 | public function isGrantTypeAllowed(string $grant_type): bool |
||
154 | |||
155 | /** |
||
156 | * @param string $response_type |
||
157 | * |
||
158 | * @return bool |
||
159 | */ |
||
160 | public function isResponseTypeAllowed(string $response_type): bool |
||
169 | |||
170 | /** |
||
171 | * @return bool |
||
172 | */ |
||
173 | public function isPublic(): bool |
||
177 | |||
178 | /** |
||
179 | * @return string |
||
180 | */ |
||
181 | public function getTokenEndpointAuthenticationMethod(): string |
||
189 | |||
190 | /** |
||
191 | * @return int |
||
192 | */ |
||
193 | public function getClientCredentialsExpiresAt(): int |
||
201 | |||
202 | /** |
||
203 | * @return bool |
||
204 | */ |
||
205 | public function areClientCredentialsExpired(): bool |
||
213 | |||
214 | /** |
||
215 | * {@inheritdoc} |
||
216 | */ |
||
217 | public function getPublicId(): ResourceOwnerId |
||
225 | |||
226 | /** |
||
227 | * {@inheritdoc} |
||
228 | */ |
||
229 | public function has(string $key): bool |
||
233 | |||
234 | /** |
||
235 | * {@inheritdoc} |
||
236 | */ |
||
237 | public function get(string $key) |
||
245 | |||
246 | /** |
||
247 | * @return array |
||
248 | */ |
||
249 | public function all(): array |
||
256 | |||
257 | /** |
||
258 | * {@inheritdoc} |
||
259 | */ |
||
260 | public function jsonSerialize() |
||
272 | |||
273 | /** |
||
274 | * @param \stdClass $json |
||
275 | * |
||
276 | * @return Client |
||
277 | */ |
||
278 | public static function createFromJson(\stdClass $json): self |
||
293 | } |
||
294 |