YamlContentProcessBase.php in YAML Content 8
File
src/Plugin/YamlContentProcessBase.php
View source
<?php
namespace Drupal\yaml_content\Plugin;
use Drupal\Core\Plugin\PluginBase;
use Drupal\Core\TypedData\Exception\MissingDataException;
abstract class YamlContentProcessBase extends PluginBase implements YamlContentProcessInterface {
protected function throwParamError($error_message, $entity_type, array $filter_params) {
$error_params = [
'[',
' "entity_type" => ' . $entity_type . ',',
];
foreach ($filter_params as $key => $value) {
$error_params[] = sprintf(" '%s' => '%s',", $key, $value);
}
$error_params[] = ']';
$param_output = implode("\n", $error_params);
throw new MissingDataException(__CLASS__ . ': ' . $error_message . ': ' . $param_output);
}
}