/**
  * Build a ComparatorVersion representing the comparator & version.
  *
  * @param Token[] $tokenList
  *
  * @return VersionRangeInterface
  */
 public function parse(array $tokenList)
 {
     $comparatorList = array('<', '<=', '>', '>=', '=');
     // Prefixed comparator, hydrate & remove
     if (count($tokenList) > 0 && in_array($tokenList[0]->getValue(), $comparatorList)) {
         $comparator = $this->comparatorFactory->get($tokenList[0]->getValue());
         $tokenList = array_slice($tokenList, 1);
         // Default to equality
     } else {
         $comparator = $this->comparatorFactory->get('=');
     }
     $chunkList = $this->chunk($tokenList);
     $versionTokenList = $chunkList[0];
     $labelTokenList = array();
     if (count($chunkList) > 1) {
         $labelTokenList = $chunkList[1];
     }
     return new ComparatorVersion($comparator, $this->versionBuilder->buildFromTokens($versionTokenList, $labelTokenList));
 }
 /**
  * Determines the correct lower version constraint for a hyphenated range.
  *
  * @param Token[] $versionTokenList
  * @param Token[] $labelTokenList
  *
  * @return VersionRangeInterface
  */
 private function getLowerConstraint(array $versionTokenList, array $labelTokenList = array())
 {
     return new ComparatorVersion($this->greaterOrEqualTo, $this->versionBuilder->buildFromTokens($versionTokenList, $labelTokenList));
 }