protected function buildMethodParametersCode(array $argumentConfigurations)
{
$preparedArguments = [];
foreach ($argumentConfigurations as $argument) {
if ($argument === null) {
$preparedArguments[] = 'NULL';
} else {
$argumentValue = $argument->getValue();
switch ($argument->getType()) {
case ConfigurationArgument::ARGUMENT_TYPES_OBJECT:
if ($argumentValue instanceof Configuration) {
$argumentValueObjectName = $argumentValue->getObjectName();
if ($this->objectConfigurations[$argumentValueObjectName]->getScope() === Configuration::SCOPE_PROTOTYPE) {
$preparedArguments[] = 'new \\' . $argumentValueObjectName . '(' . $this->buildMethodParametersCode($argumentValue->getArguments(), $this->objectConfigurations) . ')';
} else {
$preparedArguments[] = '\\Neos\\Flow\\Core\\Bootstrap::$staticObjectManager->get(\'' . $argumentValueObjectName . '\')';
}
} else {
if (strpos($argumentValue, '.') !== false) {
$settingPath = explode('.', $argumentValue);
$settings = Arrays::getValueByPath($this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS), array_shift($settingPath));
$argumentValue = Arrays::getValueByPath($settings, $settingPath);
}
$preparedArguments[] = '\\Neos\\Flow\\Core\\Bootstrap::$staticObjectManager->get(\'' . $argumentValue . '\')';
}
break;
case ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE:
$preparedArguments[] = var_export($argumentValue, true);
break;
case ConfigurationArgument::ARGUMENT_TYPES_SETTING:
$preparedArguments[] = '\\Neos\\Flow\\Core\\Bootstrap::$staticObjectManager->getSettingsByPath(explode(\'.\', \'' . $argumentValue . '\'))';
break;
}
}
}
return implode(', ', $preparedArguments);
}