function ClassResolverConstraint::__construct

Attributes

#[HasNamedArguments]

File

core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ClassResolverConstraint.php, line 46

Class

ClassResolverConstraint
Checks if a method on a service or instantiated object returns true.

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint

Code

public function __construct(mixed $options = NULL, ?string $classOrService = NULL, ?string $method = NULL, public string $message = "Calling '@method' method with value '@value' on '@classOrService' evaluated as invalid.", ?array $groups = NULL, mixed $payload = NULL) {
  parent::__construct($options, $groups, $payload);
  $this->classOrService = $classOrService ?? $this->classOrService;
  $this->method = $method ?? $this->method;
}

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