Checks if the left version is equal to the right.

@param Version $left  The left version to compare.
@param Version $right The right version to compare.

@return boolean TRUE if the left version is equal to the right, FALSE
if not.
439037
public static function isEqualTo(Version $left, Version $right)
    {
        return (self::EQUAL_TO === self::compareTo($left, $right));
    }
704169
public function isSatisfiedBy($versionInfo): bool
    {
        $versions = $this->contentService->loadVersions($versionInfo->getContentInfo());

        foreach ($versions as $checkedVersionInfo) {
            if ($checkedVersionInfo->versionNo > $versionInfo->versionNo
                && $checkedVersionInfo->isPublished()
                && $checkedVersionInfo->initialLanguageCode === $this->languageCode
            ) {
                return true;
            }
        }

        return false;
    }
667272
public static boolean isArrayEqual(final Object[] left, final Object[] right) {
        if (left == right) {
            return true;
        }
        if (left == null || right == null) {
            return false;
        }
        if (left.length != right.length) {
            return false;
        }
        for (int i = 0; i < left.length; ++i) {
            if (!isArrayElementEqual(left[i], right[i])) {
                return false;
            }
        }
        return true;
    }
1360422
public static boolean areEqual(final String left, final String right)
   {
      if ((left == null) && (right == null))
      {
         return true;
      }
      else if ((left == null) || (right == null))
      {
         return false;
      }
      return left.equals(right);
   }
392132
public static function lessThanOrEqual(Expr $left, Expr $right) : BinOp
    {
        return new BinOp($left, BinOp::LESS_THAN_OR_EQUAL, $right);
    }
358767
public function shouldProcess(Version $version)
    {
        $result = false;
        if (ExifMetadataReader::isSupported()) {
            if ($version->getTypeObject()->getName() == 'JPEG') {
                try {
                    $metadata = $version->hasImagineImage() ? $version->getImagineImage()->metadata() : null;
                    if ($metadata === null) {
                        $fr = $version->getFileResource();
                        $medatadaReader = new ExifMetadataReader();
                        $metadata = $medatadaReader->readData($fr->read());
                    }
                    switch ($metadata->get('ifd0.Orientation', null)) {
                        case 2: // top-right
                        case 3: // bottom-right
                        case 4: // bottom-left
                        case 5: // left-top
                        case 6: // right-top
                        case 7: // right-bottom
                        case 8: // left-bottom
                            $result = true;
                            break;
                    }
                } catch (Exception $x) {
                } catch (Throwable $x) {
                }
            }
        }

        return $result;
    }
821412
public function containsVersionOfFile($file, $version)
    {
        $f = $this->findVersionOfFile($file, $version);
        return  $f != null;
    }
757667
protected function mustTilde(Version $version)
    {
        if (is_null($version->getPath()))
        {
            if (is_null($version->getMinor()))
            {
                if ($version->getFloatMajor() > $this->getFloatMajor())
                    return false;
            }

            else //Minor not null
            {
                if ($version->getFloatMinor() > $this->getFloatMinor())
                    return false;

                if ($version->getFloatMajor() != $this->getFloatMajor())
                    return false;
            }
        }
        else //Path not null
        {
            if ($version->getFloatPath() > $this->getFloatPath())
                return false;

            if ($version->getFloatMinor() != $this->getFloatMinor())
                return false;

            if ($version->getFloatMajor() != $this->getFloatMajor())
                return false;
        }

        return true;
    }
1278880
public function version($version = null)
    {
        if (func_num_args() === 0) {
            return $this->_version;
        }
        $this->_version = $version;
        return $this;
    }
687813
protected function compare($left, $operator, $right)
    {
        switch ($operator) {
            case '<':
                return $left < $right;
            case '>':
                return $left > $right;
            case '<=':
                return $left <= $right;
            case '>=':
                return $left >= $right;
            case '!=':
            case '<>':
                return $left != $right;
            case '=':
                return $left == $right;
            case 'is':
                return $left === $right;
            case 'is not':
                return $left !== $right;
            default:
                throw new InvalidArgumentException("Unknown operator '$operator");
        }
    }
1142159
protected function CreateConditionEquals(Selectable $leftHandSide, Selectable $rightHandSide)
    {
        return Condition::Equals($this->connection, $leftHandSide, $rightHandSide);
    }
561339
protected function valueEquals($left, $right)
    {
        if ($left instanceof EqualityComparable) {
            return $left->isEqualTo($right, $this);
        } elseif ($right instanceof EqualityComparable) {
            return $right->isEqualTo($left, $this);
        }

        switch (gettype($left)) {
            case 'array':
                return $this->arrayEquals($left, $right);
            case 'object':
                return $this->objectEquals($left, $right);
        }

        return $left === $right;
    }
178420
public static function compareVersion($version1, $version2)
    {
        if ($version1 == $version2) {
            return 0;
        }

        $v1 = Parser::parse($version1);
        $v2 = Parser::parse($version2);

        return self::compare($v1, $v2);
    }
828712
public function compare(DeltaInterface $version1, DeltaInterface $version2)
    {
        return $this->internalComparator->compare($version1, $version2) * -1;
    }
479902
public function checkCompare($left, $operator, $right, $strict=false)
    {

        if ($strict || in_array($operator, ['is', 'is not', '=', '!=', '<>'])) {
            return $this->isComparable($left, $right) ? $this->compare($left, $operator, $right) : false;
        }

        if (!$comparable = $this->makeComparable($left, $right)) {
            return false;
        }

        list($left, $right) = $comparable;

        return $this->compare($left, $operator, $right);
    }
842811
private static function preReleaseEquals(PreRelease $v1, PreRelease $v2)
    {
        // If they don't match on the versionable level they can not match
        if (!self::versionableEquals($v1, $v2)) {
            return false;
        }

        // Both other parts need to match
        if ($v1->getGreek() !== $v2->getGreek()) {
            return false;
        }
        if ($v1->getReleaseNumber() !== $v2->getReleaseNumber()) {
            return false;
        }

        return true;
    }
494371
public function isVersionAvailable($version)
    {
        if ($this->availableVersions === null) {
            $this->registerAvailableVersions();
        }
        return isset($this->availableVersions[$version]);
    }