1717use SimpleSAML \XHTML \Template ;
1818use Symfony \Component \HttpFoundation \Cookie ;
1919use Symfony \Component \HttpFoundation \Request ;
20- use Symfony \Component \HttpFoundation \StreamedResponse ;
2120
2221/**
2322 * Controller class for the negotiate module.
@@ -247,11 +246,11 @@ public function retry(Request $request): RunnableResponse
247246 *
248247 * @param Request $request The request that lead to this retry operation.
249248 *
250- * @return \Symfony\Component\HttpFoundation\StreamedResponse
249+ * @return \SimpleSAML\HTTP\RunnableResponse
251250 * @throws \SimpleSAML\Error\BadRequest
252251 * @throws \SimpleSAML\Error\NoState
253252 */
254- public function fallback (Request $ request ): StreamedResponse
253+ public function fallback (Request $ request ): RunnableResponse
255254 {
256255 /** @psalm-var string|null $authState */
257256 $ authState = $ request ->query ->get ('AuthState ' , null );
@@ -263,23 +262,6 @@ public function fallback(Request $request): StreamedResponse
263262
264263 $ this ->logger ::debug ('backend - fallback: ' . $ state ['LogoutState ' ]['negotiate:backend ' ]);
265264
266- /** @psalm-suppress PropertyNotSetInConstructor */
267- return new class ([Negotiate::class, 'fallBack ' ], $ state ) extends StreamedResponse
268- {
269- /** @var array $state */
270- protected array $ state ;
271-
272- public function __construct (callable $ callback , array &$ state )
273- {
274- parent ::__construct ($ callback );
275- $ this ->state = $ state ;
276- }
277-
278- public function sendContent (): static
279- {
280- call_user_func_array ($ this ->callback , [&$ this ->state ]);
281- return $ this ;
282- }
283- };
265+ return new RunnableResponse ([Negotiate::class, 'fallBack ' ], [$ state ]);
284266 }
285267}
0 commit comments