Created
February 15, 2019 22:08
-
-
Save maestrojed/4dbc53b30e738fb9cd0036fff9dfef08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Drupal\Core\Extension\ModuleHandlerInterface; | |
class PermissionHandler implements PermissionHandlerInterface { | |
/** SOME OTHER METHODS REMOVED TO BE CONSISE. **/ | |
/** | |
* Returns all module names. | |
* | |
* @return string[] | |
* Returns the human readable names of all modules keyed by machine name. | |
*/ | |
protected function getModuleNames() { | |
$modules = []; | |
foreach (array_keys($this->moduleHandler->getModuleList()) as $module) { | |
$modules[$module] = $this->moduleHandler->getName($module); | |
} | |
asort($modules); | |
return $modules; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment