original_string: protected function doSort(&$array, $cmp, callable $usort, callable $sort) {
  		if (is_callable($cmp)) {
  			$usort($array, $cmp);
  		} else if ($cmp instanceof Comparator) {
  			$usort($array, function ($a, $b) use ($cmp) {
  				return $cmp->compare($a, $b);
  			});
  		} else {
  			$sort($array);
  		}
  	}
code: protected function doSort(&$array, $cmp, callable $usort, callable $sort) {
  		if (is_callable($cmp)) {
  			$usort($array, $cmp);
  		} else if ($cmp instanceof Comparator) {
  			$usort($array, function ($a, $b) use ($cmp) {
  				return $cmp->compare($a, $b);
  			});
  		} else {
  			$sort($array);
  		}
  	}
code_tokens: protected function doSort ( & $ array , $ cmp , callable $ usort , callable $ sort ) { if ( is_callable ( $ cmp ) ) { $ usort ( $ array , $ cmp ) ; } else if ( $ cmp instanceof Comparator ) { $ usort ( $ array , function ( $ a , $ b ) use ( $ cmp ) { return $ cmp -> compare ( $ a , $ b ) ; } ) ; } else { $ sort ( $ array ) ; } }
docstring: Internal sort function
  
  @param array $array the array on which is operated on
  @param Comparator|callable $cmp the compare function
  @param callable $usort the sort function for user passed $cmd
  @param callable $sort the default sort function
docstring_tokens: Internal sort function