You are here

protected function ParserBase::debug in Feeds extensible parsers 8

Renders our debug messages into a list.

Parameters

mixed $data: The result of an expression. Either a scalar or a list of scalars.

string $machine_name: The source key that produced this query.

1 call to ParserBase::debug()
ParserBase::executeSources in src/Feeds/Parser/ParserBase.php
Executes the source expressions.

File

src/Feeds/Parser/ParserBase.php, line 430

Class

ParserBase
The Feeds extensible parser.

Namespace

Drupal\feeds_ex\Feeds\Parser

Code

protected function debug($data, $machine_name) {
  $name = $machine_name;
  if ($this->configuration['sources'][$machine_name]['name']) {
    $name = $this->configuration['sources'][$machine_name]['name'];
  }
  $output = '<strong>' . $name . ':</strong>';
  $data = is_array($data) ? $data : [
    $data,
  ];
  foreach ($data as $key => $value) {
    $data[$key] = Html::escape($value);
  }
  $output .= _theme('item_list', [
    'items' => $data,
  ]);
  $this
    ->getMessenger()
    ->addMessage($output);
}