original_string: public static function order($items) {
  		if (empty($items)) {
  			return array();
  		}
  
  		$_items = array_combine(array_keys($items), Hash::extract($items, '{s}.weight'));
  		asort($_items);
  
  		foreach (array_keys($_items) as $key) {
  			$_items[$key] = $items[$key];
  		}
  
  		return $items;
  	}
code: public static function order($items) {
  		if (empty($items)) {
  			return array();
  		}
  
  		$_items = array_combine(array_keys($items), Hash::extract($items, '{s}.weight'));
  		asort($_items);
  
  		foreach (array_keys($_items) as $key) {
  			$_items[$key] = $items[$key];
  		}
  
  		return $items;
  	}
code_tokens: public static function order ( $ items ) { if ( empty ( $ items ) ) { return array ( ) ; } $ _items = array_combine ( array_keys ( $ items ) , Hash :: extract ( $ items , '{s}.weight' ) ) ; asort ( $ _items ) ; foreach ( array_keys ( $ _items ) as $ key ) { $ _items [ $ key ] = $ items [ $ key ] ; } return $ items ; }
docstring: Orders items by weight.
  
  @param array $items
  @return array
docstring_tokens: Orders items by weight .