Skip to content

Commit

Permalink
fix test for live hook update
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Apr 2, 2024
1 parent b4d3b8d commit 4121153
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions demos/_unit-test/fatal-error.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@

$runOnShutdownFx = static function (\Closure $fx) use ($app) {
// relies on https://github.com/atk4/ui/blob/5.0.0/src/App.php#L1108
$app->onHook(App::HOOK_BEFORE_RENDER, static function () use (&$fx) {
if ($fx !== null) {
try {
$fx();
} finally {
$fx = null;
}
}
$hookIndex = $app->onHook(App::HOOK_BEFORE_RENDER, static function () use ($app, &$hookIndex, $fx) {
$app->removeHook(App::HOOK_BEFORE_RENDER, $hookIndex, true);

$fx();
});
};

Expand Down

0 comments on commit 4121153

Please sign in to comment.