function RequirementsException::getRequirementsString

Same name in other branches
  1. 9 core/modules/migrate/src/Exception/RequirementsException.php \Drupal\migrate\Exception\RequirementsException::getRequirementsString()
  2. 8.9.x core/modules/migrate/src/Exception/RequirementsException.php \Drupal\migrate\Exception\RequirementsException::getRequirementsString()
  3. 10 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);
}

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