-
-
Notifications
You must be signed in to change notification settings - Fork 165
Add support for optional path argument in DebugDcaCommand #8357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.x
Are you sure you want to change the base?
Add support for optional path argument in DebugDcaCommand #8357
Conversation
The DebugDcaCommand now allows specifying a path to dump specific parts of the DCA configuration. This enhances debugging flexibility by enabling targeted output of nested DCA structures. An exception is thrown for invalid paths to ensure robust error handling.
Nice! ❤️ I would also want this for all the other tree-shaped debug outputs. 🙂 IMHO children in the path should use a dot notation( |
Iam not sure if there is an dot notation component. in my projects I use https://github.com/adbario/php-dot-notation. but i dont want to add a new dependency. There is https://symfony.com/doc/current/components/property_access.html#reading-from-arrays but the syntax is different. php bin/console debug:dca tl_member [config][sql][keys]
array:5 [
"id" => "primary"
"tstamp" => "index"
"username" => "unique"
"email" => "index"
"login,disable,start,stop" => "index"
] |
I think so too. Just split the string by dot and use the parts imho. We do that everywhere (e.g. for registering callbacks), so actually having a dot in e.g. a field name is not really supported anyway. |
If we need this in multiple classes se can create a new array helper. Maybe we copy mostly from this class https://github.com/adbario/php-dot-notation/blob/3.x/src/Dot.php Or we require this package. |
A class that does |
no, a class that also runs through the array and finds errors. like my getArray-Method. We dont want to repeat that. |
The DebugDcaCommand now allows specifying a path to dump specific parts of the DCA configuration. This enhances debugging flexibility by enabling targeted output of nested DCA structures. An exception is thrown for invalid paths to ensure robust error handling.
Now you can use something like:
You can go further is you add more keys:
If the path is not available an exception is thrown: