1 | <?php |
||
7 | class MockOAuth2Server |
||
8 | { |
||
9 | /** @var array */ |
||
10 | protected $options; |
||
11 | |||
12 | public function __construct(array $options = []) |
||
20 | |||
21 | /** |
||
22 | * @return MockHandler |
||
23 | */ |
||
24 | public function getHandler() |
||
30 | |||
31 | /** |
||
32 | * @param array $request |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | protected function getResult(array $request) |
||
49 | |||
50 | /** |
||
51 | * @param array $request |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | protected function oauth2Token(array $request) |
||
76 | |||
77 | /** |
||
78 | * @return array |
||
79 | */ |
||
80 | protected function validTokenResponse() |
||
99 | |||
100 | /** |
||
101 | * @param array $requestBody |
||
102 | * |
||
103 | * @return array |
||
104 | * The response as expected by the MockHandler. |
||
105 | */ |
||
106 | protected function grantTypePassword(array $requestBody) |
||
115 | |||
116 | /** |
||
117 | * @param array $request |
||
118 | * |
||
119 | * @return array |
||
120 | * The response as expected by the MockHandler. |
||
121 | */ |
||
122 | protected function grantTypeClientCredentials(array $request) |
||
131 | |||
132 | /** |
||
133 | * @param array $requestBody |
||
134 | * |
||
135 | * @return array |
||
136 | */ |
||
137 | protected function grantTypeRefreshToken(array $requestBody) |
||
145 | |||
146 | /** |
||
147 | * @param array $requestBody |
||
148 | * |
||
149 | * @return array |
||
150 | */ |
||
151 | protected function grantTypeJwtBearer(array $requestBody) |
||
159 | |||
160 | /** |
||
161 | * @param array $request |
||
162 | * |
||
163 | * @return array |
||
164 | */ |
||
165 | protected function mockApiCall(array $request) |
||
173 | } |
||
174 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.