You are here

public function RequirementsException::getRequirementsString in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Exception/RequirementsException.php \Drupal\migrate\Exception\RequirementsException::getRequirementsString()
  2. 9 core/modules/migrate/src/Exception/RequirementsException.php \Drupal\migrate\Exception\RequirementsException::getRequirementsString()

Get the requirements as a string.

Return value

string A formatted requirements string.

File

core/modules/migrate/src/Exception/RequirementsException.php, line 53

Class

RequirementsException
Defines an exception thrown when a migration does not meet the requirements.

Namespace

Drupal\migrate\Exception

Code

public function getRequirementsString() {
  $output = '';
  foreach ($this->requirements as $requirement_type => $requirements) {
    if (!is_array($requirements)) {
      $requirements = [
        $requirements,
      ];
    }
    foreach ($requirements as $value) {
      $output .= "{$requirement_type}: {$value}. ";
    }
  }
  return trim($output);
}