1 | <?php declare(strict_types=1); |
||
36 | trait CodeGrantTrait |
||
37 | { |
||
38 | /** |
||
39 | * @var CodeIntegrationInterface |
||
40 | */ |
||
41 | private $codeIntegration; |
||
42 | 44 | ||
43 | /** |
||
44 | 44 | * @param CodeIntegrationInterface $integration |
|
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public function codeSetIntegration(CodeIntegrationInterface $integration): void |
||
52 | 10 | ||
53 | /** |
||
54 | * @return CodeIntegrationInterface |
||
55 | */ |
||
56 | protected function codeGetIntegration(): CodeIntegrationInterface |
||
60 | 8 | ||
61 | /** |
||
62 | 8 | * @param string[] $parameters |
|
63 | * |
||
64 | * @return string|null |
||
65 | */ |
||
66 | protected function codeGetClientId(array $parameters): ?string |
||
70 | 11 | ||
71 | /** |
||
72 | 11 | * @param string[] $parameters |
|
73 | * |
||
74 | * @return string|null |
||
75 | */ |
||
76 | protected function codeGetRedirectUri(array $parameters): ?string |
||
80 | 4 | ||
81 | /** |
||
82 | 4 | * @param string[] $parameters |
|
83 | * |
||
84 | 4 | * @return string[]|null |
|
|
|||
85 | */ |
||
86 | protected function codeGetScope(array $parameters): ?array |
||
92 | 6 | ||
93 | /** |
||
94 | 6 | * @param string[] $parameters |
|
95 | * |
||
96 | * @return string|null |
||
97 | */ |
||
98 | protected function codeGetState(array $parameters): ?string |
||
102 | 6 | ||
103 | /** |
||
104 | 6 | * @param string[] $parameters |
|
105 | * |
||
106 | * @return string|null |
||
107 | */ |
||
108 | protected function codeGetCode(array $parameters): ?string |
||
112 | |||
113 | /** |
||
114 | * @param string[] $parameters |
||
115 | 6 | * @param ClientInterface $client |
|
116 | * @param string|null $redirectUri |
||
117 | * @param int|null $maxStateLength |
||
118 | * |
||
119 | * @return ResponseInterface |
||
120 | */ |
||
121 | 6 | protected function codeAskResourceOwnerForApproval( |
|
165 | |||
166 | /** |
||
167 | * @param string[] $parameters |
||
168 | * @param ClientInterface|null $determinedClient |
||
169 | * |
||
170 | 7 | * @return ResponseInterface |
|
171 | * |
||
172 | * @SuppressWarnings(PHPMD.ElseExpression) |
||
173 | 7 | * @SuppressWarnings(PHPMD.NPathComplexity) |
|
174 | 1 | * @SuppressWarnings(PHPMD.CyclomaticComplexity) |
|
175 | */ |
||
176 | protected function codeIssueToken(array $parameters, ClientInterface $determinedClient = null): ResponseInterface |
||
211 | |||
212 | 14 | /** |
|
213 | * @param array $parameters |
||
214 | 14 | * @param string $name |
|
215 | 14 | * |
|
216 | * @return null|string |
||
217 | */ |
||
218 | private function codeReadStringValue(array $parameters, string $name): ?string |
||
223 | } |
||
224 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.If the return type contains the type array, this check recommends the use of a more specific type like
String[]
orarray<String>
.