Skip to content

Commit 96586b1

Browse files
author
Greg Bowler
committed
feature: invoke Generator for go functions
1 parent 07be0a6 commit 96586b1

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

src/Middleware/RequestHandler.php

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ protected function handleCsrf(ServerRequestInterface $request):void {
270270
);
271271
$tokens = $protector->protect($sharing);
272272
$this->response = $this->response->withHeader($this->config->getString("security.csrf_header"), $tokens);
273-
}
273+
}
274274

275275
}
276276

@@ -293,20 +293,30 @@ protected function handleLogicExecution():void {
293293
$this->injector,
294294
$this->config->getString("app.namespace")
295295
);
296-
$logicExecutor->invoke("go_before");
296+
foreach($logicExecutor->invoke("go_before") as $file) {
297+
// TODO: Hook up to debug output
298+
}
297299

298300
$input = $this->serviceContainer->get(Input::class);
299301
$input->when("do")->call(
300-
fn(InputData $data) => $logicExecutor->invoke(
301-
"do_" . str_replace(
302-
"-",
303-
"_",
304-
$data->getString("do")
305-
)
306-
)
302+
function(InputData $data)use($logicExecutor) {
303+
foreach($logicExecutor->invoke(
304+
"do_" . str_replace(
305+
"-",
306+
"_",
307+
$data->getString("do")
308+
)
309+
) as $file) {
310+
// TODO: Hook up to debug output
311+
}
312+
}
307313
);
308-
$logicExecutor->invoke("go");
309-
$logicExecutor->invoke("go_after");
314+
foreach($logicExecutor->invoke("go") as $file) {
315+
// TODO: Hook up to debug output
316+
}
317+
foreach($logicExecutor->invoke("go_after") as $file) {
318+
// TODO: Hook up to debug output
319+
}
310320
}
311321

312322
protected function setupLogger(ConfigSection $logConfig):void {

0 commit comments

Comments
 (0)