Fix nested @hook/@endhook Blade directives by using stack-based approach #6

Merged
RealZone22 merged 5 commits from develop into main 2026-09-29 10:37:01 +02:00
Owner

Previously, nested hooks would cause 'Undefined variable $__hook_name' error
because the $__hook_name variable was being overwritten by inner hooks.

This fix introduces a $__hook_name_stack array to track nested hooks:

  • @hook pushes the hook name onto the stack
  • @endhook pops from the stack to get the correct hook name

This allows hooks to be nested arbitrarily deep, with each @endhook
correctly matching its corresponding @hook.

Previously, nested hooks would cause 'Undefined variable $__hook_name' error because the $__hook_name variable was being overwritten by inner hooks. This fix introduces a $__hook_name_stack array to track nested hooks: - @hook pushes the hook name onto the stack - @endhook pops from the stack to get the correct hook name This allows hooks to be nested arbitrarily deep, with each @endhook correctly matching its corresponding @hook.
Previously, nested hooks would cause 'Undefined variable $__hook_name' error
because the $__hook_name variable was being overwritten by inner hooks.

This fix introduces a $__hook_name_stack array to track nested hooks:
- @hook pushes the hook name onto the stack
- @endhook pops from the stack to get the correct hook name

This allows hooks to be nested arbitrarily deep, with each @endhook
correctly matching its corresponding @hook.
Fix HookListCommand not using all paths
Some checks failed
Fix PHP code style issues / php-code-styling (push) Failing after -1s
PHPStan / phpstan (push) Failing after 12s
run-tests / P8.3 - L11.* - prefer-lowest (push) Failing after 0s
run-tests / P8.3 - L11.* - prefer-stable (push) Failing after 0s
run-tests / P8.4 - L11.* - prefer-lowest (push) Failing after 0s
run-tests / P8.4 - L11.* - prefer-stable (push) Failing after 0s
run-tests / P8.3 - L12.* - prefer-lowest (push) Failing after 0s
run-tests / P8.3 - L12.* - prefer-stable (push) Failing after 0s
run-tests / P8.4 - L12.* - prefer-lowest (push) Failing after 0s
run-tests / P8.4 - L12.* - prefer-stable (push) Failing after 0s
40b11edcb6
Change workflows to forgejo
Fix actions
Some checks failed
PHPStan / phpstan (push) Successful in 1m3s
run-tests / P8.3 - L11.* - prefer-lowest (push) Successful in 56s
run-tests / P8.3 - L11.* - prefer-stable (push) Failing after 51s
run-tests / P8.4 - L11.* - prefer-lowest (push) Successful in 49s
run-tests / P8.4 - L11.* - prefer-stable (push) Successful in 49s
run-tests / P8.3 - L12.* - prefer-lowest (push) Successful in 50s
run-tests / P8.3 - L12.* - prefer-stable (push) Successful in 48s
run-tests / P8.4 - L12.* - prefer-lowest (push) Successful in 49s
run-tests / P8.4 - L12.* - prefer-stable (push) Successful in 50s
3cd23b4420
Change Laravel version
All checks were successful
Fix PHP code style issues / php-code-styling (push) Successful in 11s
PHPStan / phpstan (push) Successful in 51s
run-tests / P8.4 - L12.* - prefer-stable (push) Successful in 54s
run-tests / P8.4 - L13.* - prefer-stable (push) Successful in 55s
ce51c60746
Formatting
Fix styling
Some checks were skipped
dependabot-auto-merge / dependabot (pull_request_target) Has been skipped
05a3efa10c
RealZone22 deleted branch develop 2026-09-29 10:37:01 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
RealZone22/LaraHooks!6
No description provided.