original_string: protected function sortByWeight(array $definitions) {
      // Sort definitions by weight before returning.
      uasort($definitions, function ($first, $second) {
        if ($first['weight'] === $second['weight']) {
          return 0;
        }
        return ($first['weight'] < $second['weight']) ? -1 : 1;
      });
  
      return $definitions;
    }
code: protected function sortByWeight(array $definitions) {
      // Sort definitions by weight before returning.
      uasort($definitions, function ($first, $second) {
        if ($first['weight'] === $second['weight']) {
          return 0;
        }
        return ($first['weight'] < $second['weight']) ? -1 : 1;
      });
  
      return $definitions;
    }
code_tokens: protected function sortByWeight ( array $ definitions ) { // Sort definitions by weight before returning. uasort ( $ definitions , function ( $ first , $ second ) { if ( $ first [ 'weight' ] === $ second [ 'weight' ] ) { return 0 ; } return ( $ first [ 'weight' ] < $ second [ 'weight' ] ) ? - 1 : 1 ; } ) ; return $ definitions ; }
docstring: Sorts plugins by weight.
  
  @param array $definitions
  List of plugin definitions, each MUST have a 'weight' key.
  
  @return array
  Sorted definitions.
docstring_tokens: Sorts plugins by weight .