I am using the OptionsResolver component to set my default settings in a class. Since I'm having a large amount of parameters, I've created a multidimensional array:
<?php
$resolver = new OptionsResolver();
$resolver->setDefaults([
'db' => [
'hostname' => 'localhost',
'username' => 'root'
]
]);
?>
Now I want to overrule the username, but not the hostname. If I do
$resolver->resolve(['db' => ['username' => 'test']);
the hostname param is gone.
Can I a multidimensional array with the OptionsResolver component?