From 4f18d6227203dfbc4baaf27e962e876686692922 Mon Sep 17 00:00:00 2001 From: Andreas Hennings <andreas@dqxtech.net> Date: Sat, 4 Jan 2014 04:50:18 +0100 Subject: [PATCH] Issue #2083547 by donquixote: Docblock and code style improvements in DrupalKernel. This is in preparation for the switch of module-provided classes from PSR-0 to PSR-4. --- core/lib/Drupal/Core/DrupalKernel.php | 28 +++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 8812cab8d091..36e8834c0247 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -249,7 +249,6 @@ public function discoverServiceProviders() { return $serviceProviders; } - /** * {@inheritdoc} */ @@ -681,7 +680,11 @@ protected function getModulesParameter() { } /** - * Returns the file name for each enabled module. + * Gets the file name for each enabled module. + * + * @return array + * Array where each key is a module name, and each value is a path to the + * respective *.module or *.profile file. */ protected function getModuleFileNames() { $filenames = array(); @@ -694,18 +697,31 @@ protected function getModuleFileNames() { } /** - * Gets the namespaces of each enabled module. + * Gets the PSR-0 base directories for module namespaces. + * + * @param array $module_file_names + * Array where each key is a module name, and each value is a path to the + * respective *.module or *.profile file. + * + * @return array + * Array where each key is a module namespace like 'Drupal\system', and each + * value is a PSR-0 base directory associated with the module namespace. */ - protected function getModuleNamespaces($moduleFileNames) { + protected function getModuleNamespaces($module_file_names) { $namespaces = array(); - foreach ($moduleFileNames as $module => $filename) { + foreach ($module_file_names as $module => $filename) { $namespaces["Drupal\\$module"] = DRUPAL_ROOT . '/' . dirname($filename) . '/lib'; } return $namespaces; } /** - * Registers a list of namespaces. + * Registers a list of namespaces with PSR-0 directories for class loading. + * + * @param array $namespaces + * Array where each key is a namespace like 'Drupal\system', and each value + * is either a PSR-0 base directory, or an array of PSR-0 base directories + * associated with this namespace. */ protected function registerNamespaces(array $namespaces = array()) { foreach ($namespaces as $prefix => $path) { -- GitLab