You are here

public function PeclExtension::__construct in Markdown 8.2

AnnotationObject constructor.

Parameters

array $values: Optional. The initial values to populate the annotation with.

Overrides InstallableLibrary::__construct

File

src/Annotation/PeclExtension.php, line 28

Class

PeclExtension
PeclExtension Annotation.

Namespace

Drupal\markdown\Annotation

Code

public function __construct($values = []) {
  parent::__construct($values);

  // Add the necessary PHP requirement.
  if (($info = $this
    ->getPackageInfo()) && !empty($info['dependencies']['required']['php']['min'])) {
    $this->requirements[] = InstallableRequirement::create([
      'value' => PHP_VERSION,
      'constraints' => [
        'Version' => [
          'name' => 'PHP',
          'value' => '>=' . $info['dependencies']['required']['php']['min'],
        ],
      ],
    ]);
  }
}