Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Constraint.php

function Constraint::__construct

Same name in this branch
  1. 11.1.x vendor/composer/semver/src/Constraint/Constraint.php \Composer\Semver\Constraint\Constraint::__construct()
  2. 11.1.x vendor/symfony/validator/Constraint.php \Symfony\Component\Validator\Constraint::__construct()
  3. 11.1.x core/lib/Drupal/Core/Validation/Attribute/Constraint.php \Drupal\Core\Validation\Attribute\Constraint::__construct()

Constraint constructor.

Parameters

string $constraint: The constraint string to create the object from. For example, '>8.x-1.1'.

string $core_compatibility: Core compatibility declared for the current version of Drupal core. Normally this is set to \Drupal::CORE_COMPATIBILITY by the caller.

File

core/lib/Drupal/Component/Version/Constraint.php, line 37

Class

Constraint
A value object representing a Drupal version constraint.

Namespace

Drupal\Component\Version

Code

public function __construct($constraint, $core_compatibility) {
    $this->constraint = $constraint;
    $this->parseConstraint($constraint, $core_compatibility);
}
RSS feed
Powered by Drupal