code: 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;
      }
docs: @param Definition[] $definitions
  
  @return Definition[]