private function sortDefinitions(array $definitions)
    {
        usort($definitions, function (Definition $definitionLeft, Definition $definitionRight) {
            if ($definitionLeft->getPriority() === $definitionRight->getPriority()) {
                return 0;
            }

            return ($definitionLeft->getPriority() > $definitionRight->getPriority()) ? -1 : 1;
        });

        return $definitions;
    }
private function sortDefinitions(array $definitions)
    {
        usort($definitions, function (Definition $definitionLeft, Definition $definitionRight) {
            if ($definitionLeft->getPriority() === $definitionRight->getPriority()) {
                return 0;
            }

            return ($definitionLeft->getPriority() > $definitionRight->getPriority()) ? -1 : 1;
        });

        return $definitions;
    }
@param Definition[] $definitions

@return Definition[]