function SandboxEventException::getResultsAsText

Formats the validation results, if any, as plain text.

Return value

string The results, formatted as plain text.

1 call to SandboxEventException::getResultsAsText()
SandboxEventException::__construct in core/modules/package_manager/src/Exception/SandboxEventException.php
Constructs a StageEventException object.

File

core/modules/package_manager/src/Exception/SandboxEventException.php, line 41

Class

SandboxEventException
Exception thrown if an error related to an event occurs.

Namespace

Drupal\package_manager\Exception

Code

protected function getResultsAsText() : string {
  $text = '';
  if ($this->event instanceof SandboxValidationEvent) {
    foreach ($this->event
      ->getResults() as $result) {
      $messages = $result->messages;
      $summary = $result->summary;
      if ($summary) {
        array_unshift($messages, $summary);
      }
      $text .= implode("\n", $messages) . "\n";
    }
  }
  return $text;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.