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

Breadcrumb

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

function VersionConstraintValue::parseVersion

1 call to VersionConstraintValue::parseVersion()
VersionConstraintValue::__construct in vendor/phar-io/version/src/VersionConstraintValue.php

File

vendor/phar-io/version/src/VersionConstraintValue.php, line 53

Class

VersionConstraintValue

Namespace

PharIo\Version

Code

private function parseVersion(string $versionString) : void {
    $this->extractBuildMetaData($versionString);
    $this->extractLabel($versionString);
    $this->stripPotentialVPrefix($versionString);
    $versionSegments = \explode('.', $versionString);
    $this->major = new VersionNumber(\is_numeric($versionSegments[0]) ? (int) $versionSegments[0] : null);
    $minorValue = isset($versionSegments[1]) && \is_numeric($versionSegments[1]) ? (int) $versionSegments[1] : null;
    $patchValue = isset($versionSegments[2]) && \is_numeric($versionSegments[2]) ? (int) $versionSegments[2] : null;
    $this->minor = new VersionNumber($minorValue);
    $this->patch = new VersionNumber($patchValue);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal