Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Framework][debug:config] Allow to debug path with dot in key#64233

Open
Jibbarth wants to merge 1 commit into
symfony:8.1from
Jibbarth:feature/debug-conf-with-dot-in-key
Open

[Framework][debug:config] Allow to debug path with dot in key#64233
Jibbarth wants to merge 1 commit into
symfony:8.1from
Jibbarth:feature/debug-conf-with-dot-in-key

Conversation

@Jibbarth
Copy link
Copy Markdown
Contributor

Q A
Branch? 8.1 - TODO change for 8.2 when available
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #...
License MIT

This allow to debug config path with dot in key.

When an arrayNode use attribute as key, we can have dots inside the key. It's happen a lot in sylius with twig_hooks :

❯ php bin/console debug:config sylius_twig_hooks hooks 

Current configuration for "sylius_twig_hooks.hooks"
===================================================

sylius_admin.admin_user.create.content:
    form:
        component: 'sylius_admin:admin_user:form'
        props:
            resource: '@=_context.resource'
            form: '@=_context.form'
            template: '@SyliusAdmin/shared/crud/common/content/form.html.twig'
        configuration:
            render_rest: false
        priority: 0
        type: component
        enabled: true
        template: null
        context: {  }
sylius_admin.admin_user.create.content.form:
   [...]

As there is a lot of configuration here, it's quite difficult to find the data needed.

With that change, we can pass a key that contains dot within brackets:

❯ php bin/console deb:conf sylius_twig_hooks "hooks.[sylius_admin.common.show]"

Current configuration for "sylius_twig_hooks.hooks.[sylius_admin.common.show]"
==============================================================================

sidebar:
    template: '@SyliusAdmin/shared/crud/common/sidebar.html.twig'
    priority: 200
    type: template
    enabled: true
    component: null
    context: {  }
    props: {  }
    configuration: {  }
navbar:
    template: '@SyliusAdmin/shared/crud/common/navbar.html.twig'
    priority: 100
    type: template
    enabled: true
    component: null
    context: {  }
    props: {  }
    configuration: {  }
content:
    template: '@SyliusAdmin/shared/crud/common/content.html.twig'
    priority: 0
    type: template
    enabled: true
    component: null
    context: {  }
    props: {  }
    configuration: {  }

@carsonbot
Copy link
Copy Markdown

Hey!

Thanks for your PR. You are targeting branch "8.1" but it seems your PR description refers to branch "8.1 - TODO change for 8.2 when available".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

private function getConfigForPath(array $config, string $path, string $alias): mixed
{
$steps = explode('.', $path);
preg_match_all('/\[([^\]]+)\]|[^.]+/', $path, $matches);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jibbarth Jibbarth force-pushed the feature/debug-conf-with-dot-in-key branch from 61cda7b to db59a7f Compare May 17, 2026 10:19
@Jibbarth Jibbarth force-pushed the feature/debug-conf-with-dot-in-key branch from db59a7f to d266f5c Compare May 17, 2026 10:22
@nicolas-grekas nicolas-grekas modified the milestones: 8.1, 8.2 May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants