public static function ExtensionList::sortByName in Drupal 9
Array sorting callback; sorts extensions by their name.
Parameters
\Drupal\Core\Extension\Extension $a: The first extension to compare.
\Drupal\Core\Extension\Extension $b: The second extension to compare.
Return value
int Less than 0 if $a is less than $b, more than 0 if $a is greater than $b, and 0 if they are equal.
File
- core/
lib/ Drupal/ Core/ Extension/ ExtensionList.php, line 595
Class
- ExtensionList
- Provides available extensions.
Namespace
Drupal\Core\ExtensionCode
public static function sortByName(Extension $a, Extension $b) : int {
return strcasecmp($a->info['name'], $b->info['name']);
}