function AuditResult::__construct

Same name in other branches
  1. 9 core/modules/migrate/src/Audit/AuditResult.php \Drupal\migrate\Audit\AuditResult::__construct()
  2. 10 core/modules/migrate/src/Audit/AuditResult.php \Drupal\migrate\Audit\AuditResult::__construct()
  3. 11.x core/modules/migrate/src/Audit/AuditResult.php \Drupal\migrate\Audit\AuditResult::__construct()

AuditResult constructor.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration: The audited migration.

bool $status: The result of the audit (TRUE if passed, FALSE otherwise).

string[] $reasons: (optional) The reasons why the migration passed or failed the audit.

File

core/modules/migrate/src/Audit/AuditResult.php, line 44

Class

AuditResult
Encapsulates the result of a migration audit.

Namespace

Drupal\migrate\Audit

Code

public function __construct(MigrationInterface $migration, $status, array $reasons = []) {
    if (!is_bool($status)) {
        throw new \InvalidArgumentException('Audit results must have a boolean status.');
    }
    $this->migration = $migration;
    $this->status = $status;
    array_walk($reasons, [
        $this,
        'addReason',
    ]);
}

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