Skip to content

Comments

[TwigHooks] Add debug command to display hooks and hookables#326

Merged
loic425 merged 5 commits intoSylius:mainfrom
camilleislasse:feature/debug-twig-hooks-command
Feb 19, 2026
Merged

[TwigHooks] Add debug command to display hooks and hookables#326
loic425 merged 5 commits intoSylius:mainfrom
camilleislasse:feature/debug-twig-hooks-command

Conversation

@camilleislasse
Copy link
Contributor

Summary

Add sylius:debug:twig-hooks console command to list and inspect Twig hooks configuration.

Features

  • List all hooks with hookable count
  • Filter hooks by name (case-insensitive)
  • Show hook details with hookables (name, type, target, priority)
  • --all option to include disabled hookables with status column
  • --config option to display hookable configuration
  • Shell autocompletion for hook names

Usage

# List all hooks                                                                                                                                                               
bin/console sylius:debug:twig-hooks                                                                                                                                            
                                                                                                                                                                               
# Filter by name                                                                                                                                                               
bin/console sylius:debug:twig-hooks sylius_admin                                                                                                                               
                                                                                                                                                                               
# Show details for a specific hook                                                                                                                                             
bin/console sylius:debug:twig-hooks sylius_admin.common.component.sidebar                                                                                                      
                                                                                                                                                                               
# Include disabled hookables                                                                                                                                                   
bin/console sylius:debug:twig-hooks sylius_admin.common.component.sidebar --all                                                                                                
                                                                                                                                                                               
# Show configuration                                                                                                                                                           
bin/console sylius:debug:twig-hooks sylius_admin.common.component.sidebar --config                                                                                             

Changes

  • Add DebugTwigHooksCommand class
  • Add getHookNames() and getAllFor() methods to HookablesRegistry
  • Register command as service

@camilleislasse camilleislasse force-pushed the feature/debug-twig-hooks-command branch from 7c8ccca to be1e4e6 Compare February 11, 2026 11:49
Add `sylius:debug:twig-hooks` command to list and inspect Twig hooks.

Features:
- List all hooks with hookable count
- Filter hooks by name (case-insensitive)
- Show hook details with hookables (name, type, target, priority)
- `--all` option to include disabled hookables
- `--config` option to display hookable configuration
- Shell autocompletion for hook names
- Rename $h to $hookable for clarity
- Use VarExporter instead of custom formatValue logic
@camilleislasse camilleislasse force-pushed the feature/debug-twig-hooks-command branch from be1e4e6 to d08e25b Compare February 18, 2026 05:22
@crydotsnake crydotsnake self-requested a review February 18, 2026 10:09
@loic425 loic425 merged commit 77e5808 into Sylius:main Feb 19, 2026
6 checks passed
@loic425
Copy link
Member

loic425 commented Feb 19, 2026

Thx @camilleislasse 🏅

@crydotsnake crydotsnake removed their request for review February 21, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants