function ValidationResult::createError

Creates an error ValidationResult object.

Parameters

\Drupal\Core\StringTranslation\TranslatableMarkup[] $messages: The error messages.

\Drupal\Core\StringTranslation\TranslatableMarkup|null $summary: The errors summary.

Return value

static

52 calls to ValidationResult::createError()
AllowedScaffoldPackagesValidatorTest::testPreApply in core/modules/package_manager/tests/src/Kernel/AllowedScaffoldPackagesValidatorTest.php
Tests that the allowed-packages setting is validated during pre-apply.
AllowedScaffoldPackagesValidatorTest::testPreCreate in core/modules/package_manager/tests/src/Kernel/AllowedScaffoldPackagesValidatorTest.php
Tests that the allowed-packages setting is validated during pre-create.
BaseRequirementsFulfilledValidatorTest::testBaseRequirement in core/modules/package_manager/tests/src/Kernel/BaseRequirementsFulfilledValidatorTest.php
Tests that base requirement failures stop event propagation.
ComposerMinimumStabilityValidatorTest::testPreRequireEvent in core/modules/package_manager/tests/src/Kernel/ComposerMinimumStabilityValidatorTest.php
Tests error if requested version is less stable than the minimum: stable.
ComposerPatchesValidatorTest::providerErrorDuringPreApply in core/modules/package_manager/tests/src/Kernel/ComposerPatchesValidatorTest.php
Data provider for testErrorDuringPreApply() and testHelpLink().

... See full list

File

core/modules/package_manager/src/ValidationResult.php, line 92

Class

ValidationResult
A value object to contain the results of a validation.

Namespace

Drupal\package_manager

Code

public static function createError(array $messages, ?TranslatableMarkup $summary = NULL) : static {
    return new static(SystemManager::REQUIREMENT_ERROR, $messages, $summary, TRUE);
}

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