AuditResult
class AuditResult implements MarkupInterface, Countable (View source)
Encapsulates the result of a migration audit.
Properties
| protected MigrationInterface | $migration | The audited migration. |
|
| protected bool | $status | The result of the audit (TRUE if passed, FALSE otherwise). |
|
| protected string[] | $reasons | The reasons why the migration passed or failed the audit. |
Methods
AuditResult constructor.
Returns the audited migration.
Returns the boolean result of the audit.
Adds a reason why the migration passed or failed the audit.
Creates a passing audit result for a migration.
Creates a failing audit result for a migration.
Implements \Countable::count() for Twig template compatibility.
Returns the reasons the migration passed or failed, as a string.
Returns the reasons the migration passed or failed, for JSON serialization.
Details
__construct(MigrationInterface $migration, bool $status, array $reasons = [])
AuditResult constructor.
MigrationInterface
getMigration()
Returns the audited migration.
bool
passed()
Returns the boolean result of the audit.
$this
addReason(string|object $reason)
Adds a reason why the migration passed or failed the audit.
static AuditResult
pass(MigrationInterface $migration, array $reasons = [])
Creates a passing audit result for a migration.
static AuditResult
fail(MigrationInterface $migration, array $reasons = [])
Creates a failing audit result for a migration.
int
count()
Implements \Countable::count() for Twig template compatibility.
string
__toString()
Returns the reasons the migration passed or failed, as a string.
string[]
jsonSerialize()
Returns the reasons the migration passed or failed, for JSON serialization.