Exemplo n.º 1
0
 /**
  * @return bool
  */
 public function isLatest()
 {
     $constraint = new Constraint('==', $this->latestPackage->getVersion());
     return $constraint->matches($this->getCurrentVersion());
 }
Exemplo n.º 2
0
 /**
  * Evaluates the expression: $version1 $operator $version2.
  *
  * @param string $version1
  * @param string $operator
  * @param string $version2
  *
  * @return bool
  */
 public static function compare($version1, $operator, $version2)
 {
     $constraint = new Constraint($operator, $version2);
     return $constraint->matches(new Constraint('==', $version1));
 }