You are here

private static function UnusedModulesHelperService::sortByProject in Unused Modules 8

Sort helper. Used as uasort() callback.

Parameters

\Drupal\unused_modules\UnusedModulesExtensionDecorator $a:

\Drupal\unused_modules\UnusedModulesExtensionDecorator $b:

Return value

\Drupal\unused_modules\UnusedModulesExtensionDecorator

File

src/UnusedModulesHelperService.php, line 233

Class

UnusedModulesHelperService
Common Unused Modules functionality.

Namespace

Drupal\unused_modules

Code

private static function sortByProject($a, $b) {

  // Sort by module name if from same project.
  if ($a->projectName === $b->projectName) {
    return strnatcmp($a
      ->getPathname(), $b
      ->getPathname());
  }

  // Fallback sort by project name.
  return strnatcmp($a->projectName, $b->projectName);
}