2 declare(strict_types = 1);
69 $rawFormDefinitionArray = json_decode($source,
true);
71 if (json_last_error() !== JSON_ERROR_NONE) {
72 throw new PropertyException(
'Unable to decode JSON source: ' . json_last_error_msg(), 1512578002);
82 $prototypeName = $rawFormDefinitionArray[
'prototypeName'] ??
null;
83 $identifier = $rawFormDefinitionArray[
'identifier'] ??
null;
88 if (!$formDefinitionValidationService->isPropertyValueEqualToHistoricalValue([$identifier,
'identifier'], $identifier, $rawFormDefinitionArray[
'_orig_identifier'] ?? [], $sessionToken)) {
89 throw new PropertyException(
'Unauthorized modification of "identifier".', 1528538324);
92 if (!$formDefinitionValidationService->isPropertyValueEqualToHistoricalValue([$identifier,
'prototypeName'], $prototypeName, $rawFormDefinitionArray[
'_orig_prototypeName'] ?? [], $sessionToken)) {
93 throw new PropertyException(
'Unauthorized modification of "prototype name".', 1528538323);
96 throw new PropertyException(
'Unauthorized modification of "prototype name" or "identifier".', 1528538322);
99 $formDefinitionValidationService->validateFormDefinitionProperties($rawFormDefinitionArray, $prototypeName, $sessionToken);
106 $rawFormDefinitionArray = $formDefinitionConversionService->removeHmacData($rawFormDefinitionArray);
108 $formDefinitionArray = GeneralUtility::makeInstance(FormDefinitionArray::class, $rawFormDefinitionArray);
109 return $formDefinitionArray;
135 foreach ($input as $key => $value) {
136 if (is_int($key) && is_array($value) && isset($value[
'_label']) && isset($value[
'_value'])) {
137 $key = $value[
'_value'];
138 $value = $value[
'_label'];
141 if (is_array($value)) {
160 foreach ($array as $key => $value) {
161 if (!is_array($value)) {
169 if (empty($array[$key])) {
190 return GeneralUtility::makeInstance(FormDefinitionValidationService::class);
198 return GeneralUtility::makeInstance(FormDefinitionConversionService::class);