private function BenchmarkCommand::getOrderedDatas in Devel 8
Same name and namespace in other branches
- 8.3 webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getOrderedDatas()
- 8.2 webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getOrderedDatas()
- 4.x webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getOrderedDatas()
Parameters
\Drupal\webprofiler\Command\BenchmarkData[] $datas:
$string:
Return value
array
1 call to BenchmarkCommand::getOrderedDatas()
- BenchmarkCommand::computePercentile in webprofiler/
src/ Command/ BenchmarkCommand.php - Computes percentile using The Nearest Rank method.
File
- webprofiler/
src/ Command/ BenchmarkCommand.php, line 247
Class
- BenchmarkCommand
- Class BenchmarkCommand
Namespace
Drupal\webprofiler\CommandCode
private function getOrderedDatas(&$datas, $string) {
usort($datas, function ($a, $b) use ($string) {
$method = 'get' . $string;
if ($a->{$method} > $b->{$method}) {
return 1;
}
if ($a->{$method} < $b->{$method}) {
return -1;
}
return 0;
});
}