foreach ($chunks as $chunk) { if (isset($chunk[1
])) { // check if the parameter is a valid array or just a simple value
parse_str($chunk[1
],
$parsed);
$query[$chunk[0
]] =
(\
count($parsed) === 1 &&
reset($parsed) === ''
) ?
$chunk[1
] :
$parsed;
} else { $query[$chunk[0
]] = '';
} } } return $this->
fillDefaults($context,
$query);
} /**
* Fills up default values for module, controller and action
*/
private function fillDefaults(Context
$context, array
$query): array
{ $defaults =
[ $context->
getModuleKey() =>
$this->dispatcher->
getDefaultModule(),
$context->
getControllerKey() =>
$this->dispatcher->
getDefaultControllerName(),
$context->
getActionKey() =>
$this->dispatcher->
getDefaultAction(),
];