protected function WebformEntityElementsValidator::validateProperties in Webform 8.5
Same name and namespace in other branches
- 6.x src/WebformEntityElementsValidator.php \Drupal\webform\WebformEntityElementsValidator::validateProperties()
Validate that elements are not using ignored properties.
Return value
array|null If not valid, an array of error messages.
1 call to WebformEntityElementsValidator::validateProperties()
- WebformEntityElementsValidator::validate in src/
WebformEntityElementsValidator.php - Validate webform elements.
File
- src/
WebformEntityElementsValidator.php, line 375
Class
- WebformEntityElementsValidator
- Webform elements validator.
Namespace
Drupal\webformCode
protected function validateProperties() {
$ignored_properties = WebformElementHelper::getIgnoredProperties($this->elements);
if ($ignored_properties) {
$messages = [];
foreach ($ignored_properties as $ignored_property => $ignored_message) {
if ($ignored_property !== $ignored_message) {
$messages[] = $ignored_message;
}
else {
$line_numbers = $this
->getLineNumbers('/^\\s*(["\']?)' . preg_quote($ignored_property, '/') . '\\1\\s*:/');
$t_args = [
'%property' => $ignored_property,
'@line_number' => WebformArrayHelper::toString($line_numbers),
];
$messages[] = $this
->formatPlural(count($line_numbers), 'Elements contain an unsupported %property property found on line @line_number.', 'Elements contain an unsupported %property property found on lines @line_number.', $t_args);
}
}
return $messages;
}
return NULL;
}