CssSelectorConstraint.php

Namespace

Drupal\Core\Theme\Plugin\Validation\Constraint

File

core/lib/Drupal/Core/Theme/Plugin/Validation/Constraint/CssSelectorConstraint.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Core\Theme\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;

/**
 * Checks if the string is a correct CSS selector.
 */
class CssSelectorConstraint extends SymfonyConstraint {
  public function __construct(public string $message = 'The CSS selector @scope is invalid.', ?array $groups = NULL, mixed $payload = NULL) {
    parent::__construct(groups: $groups, payload: $payload);
  }

}

Classes

Title Deprecated Summary
CssSelectorConstraint Checks if the string is a correct CSS selector.

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