public static function ConfigDependencyManager::sortGraph
public static ConfigDependencyManager::sortGraph(array $a, array $b)
Sorts the dependency graph by reverse weight and alphabetically.
Parameters
array $a: First item for comparison. The compared items should be associative arrays that include a 'weight' and a 'name' key.
array $b: Second item for comparison.
Return value
int The comparison result for uasort().
File
- core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php, line 230
Class
- ConfigDependencyManager
- Provides a class to discover configuration entity dependencies.
Namespace
Drupal\Core\Config\EntityCode
public static function sortGraph(array $a, array $b) { $weight_cmp = SortArray::sortByKeyInt($a, $b, 'weight') * -1; if ($weight_cmp === 0) { return SortArray::sortByKeyString($a, $b, 'name'); } return $weight_cmp; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!Entity!ConfigDependencyManager.php/function/ConfigDependencyManager::sortGraph/8.1.x