class RestTestConstraint

Same name and namespace in other branches
  1. 11.x core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php \Drupal\rest_test\Plugin\Validation\Constraint\RestTestConstraint
  2. 10 core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php \Drupal\rest_test\Plugin\Validation\Constraint\RestTestConstraint
  3. 9 core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php \Drupal\rest_test\Plugin\Validation\Constraint\RestTestConstraint
  4. 8.9.x core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php \Drupal\rest_test\Plugin\Validation\Constraint\RestTestConstraint

Adds some validations for a REST test field.

Attributes

#[Constraint(id: 'rest_test_validation', label: new TranslatableMarkup('REST test validation', [], [ 'context' => 'Validation', ]))]

Hierarchy

  • class \Drupal\rest_test\Plugin\Validation\Constraint\RestTestConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of RestTestConstraint

See also

\Drupal\Core\TypedData\OptionsProviderInterface

File

core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php, line 17

Namespace

Drupal\rest_test\Plugin\Validation\Constraint
View source
class RestTestConstraint extends SymfonyConstraint {
  public function __construct(mixed $options = NULL, public string $message = 'REST test validation failed', ?array $groups = NULL, mixed $payload = NULL) {
    parent::__construct($options, $groups, $payload);
  }

}

Members

Title Sort descending Modifiers Object type Summary
RestTestConstraint::__construct public function #[HasNamedArguments]

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