function InvalidConfigException::__construct

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Recipe/InvalidConfigException.php \Drupal\Core\Recipe\InvalidConfigException::__construct()

Constructs an InvalidConfigException object.

Parameters

\Symfony\Component\Validator\ConstraintViolationList $violations: The validation constraint violations.

\Drupal\Core\Config\Schema\Mapping $data: A typed data wrapper around the invalid config data.

string $message: (optional) The exception message. Defaults to the string representation of the constraint violation list.

int $code: (optional) The exception code. Defaults to 0.

\Throwable|null $previous: (optional) The previous exception, if any.

File

core/lib/Drupal/Core/Recipe/InvalidConfigException.php, line 33

Class

InvalidConfigException
Thrown if config created or changed by a recipe fails validation.

Namespace

Drupal\Core\Recipe

Code

public function __construct(ConstraintViolationList $violations, Mapping $data, string $message = '', int $code = 0, ?\Throwable $previous = NULL) {
    parent::__construct($message ?: $this->formatMessage(), $code, $previous);
}

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