Skip to content

Commit

Permalink
Fix wrong resolving of config in ArrayObject by exchangeArray
Browse files Browse the repository at this point in the history
  • Loading branch information
shakaran committed Sep 28, 2017
1 parent 265dd59 commit a6afac0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Helper/ContextHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,26 @@ public function __construct(array $config, RouteAliasCollection $router)
*/
protected function initialize(array $config = [])
{
// Remove casting if present
if(isset($config['0']))
{
unset($config['0']);
}

$resolver = new OptionsResolver();
$this->configureDefaults($resolver);

if(!empty($config))
{
try
{
$this->exchangeArray($resolver->resolve($config));
$newConfig = $resolver->resolve($config);

foreach($newConfig as $configKey => $configValue)
{
//if(!is_array($configValue))
//{
$this->setOption($configKey, $configValue);
//}
//else @todo Not sure if it is needed handle second level index of arrays
//{

//}
}
}
catch(UndefinedOptionsException $e)
{
Expand Down

0 comments on commit a6afac0

Please sign in to comment.