HippoPHP\Hippo\CheckResult::sortViolations PHP Method

sortViolations() private method

Sorts the violations by line then column.
private sortViolations ( )
    private function sortViolations()
    {
        usort($this->violations, function (Violation $a, Violation $b) {
            if ($a->getLine() === $b->getLine()) {
                if ($a->getColumn() === $b->getColumn()) {
                    return 0;
                }
                return $a->getColumn() < $b->getColumn() ? -1 : 1;
            }
            return $a->getLine() < $b->getLine() ? -1 : 1;
        });
    }