protected function matchCurrentPathPart($pathPart, $previousConfiguration, &$currentPrototypeDefinitions)
{
if (preg_match('#^([^<]*)(<(.*?)>)?$#', $pathPart, $matches) !== 1) {
throw new Exception('Path Part ' . $pathPart . ' not well-formed', 1332494645);
}
$currentPathSegment = $matches[1];
$configuration = [];
if (isset($previousConfiguration[$currentPathSegment])) {
$configuration = is_array($previousConfiguration[$currentPathSegment]) ? $previousConfiguration[$currentPathSegment] : $this->simpleTypeToArrayClosure->__invoke($previousConfiguration[$currentPathSegment]);
}
if (isset($configuration['__prototypes'])) {
$currentPrototypeDefinitions = Arrays::arrayMergeRecursiveOverruleWithCallback($currentPrototypeDefinitions, $configuration['__prototypes'], $this->simpleTypeToArrayClosure);
}
$currentPathSegmentType = null;
if (isset($configuration['__objectType'])) {
$currentPathSegmentType = $configuration['__objectType'];
}
if (isset($matches[3])) {
$currentPathSegmentType = $matches[3];
}
if ($currentPathSegmentType !== null) {
$configuration['__objectType'] = $currentPathSegmentType;
$configuration = $this->mergePrototypesWithConfigurationForPathSegment($configuration, $currentPrototypeDefinitions);
}
if (is_array($configuration) && !isset($configuration['__value']) && !isset($configuration['__eelExpression']) && !isset($configuration['__meta']['class']) && !isset($configuration['__objectType']) && isset($configuration['__meta']['process'])) {
$configuration['__value'] = '';
}
return $configuration;
}