diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 8fad9b1..b505a7b 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2762,8 +2762,8 @@ function language($type) { } if (!$container->has('language_manager')) { // This happens in rare situations when the container has not been built by - // a kernel and has no services e.g. when t() is called during unit tests for - // assertions. + // a kernel and has no services, e.g., when t() is called during unit tests + // for assertions. $container->register('language_manager', 'Drupal\Core\Language\LanguageManager'); } return $container->get('language_manager')->getLanguage($type); @@ -2972,7 +2972,7 @@ function language_default() { } /** - * Store or retrieve the path derived during language negotiation. + * Stores or retrieves the path derived during language negotiation. * * @todo Replace this with a path processor in language module. See * http://drupal.org/node/1888424. diff --git a/core/lib/Drupal/Core/EventSubscriber/LanguageRequestSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/LanguageRequestSubscriber.php index 66fdd61..0969223 100644 --- a/core/lib/Drupal/Core/EventSubscriber/LanguageRequestSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/LanguageRequestSubscriber.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\Core\EventSubscriber\LanguageRequestSubscriber. + * Contains \Drupal\Core\EventSubscriber\LanguageRequestSubscriber. */ namespace Drupal\Core\EventSubscriber; @@ -14,12 +14,12 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** - * Request subscriber to set the $request proprerty on the language manager. + * Sets the $request proprerty on the language manager. */ class LanguageRequestSubscriber implements EventSubscriberInterface { /** - * The language manager service + * The language manager service. * * @var \Drupal\Core\Language\LanguageManager */ @@ -39,7 +39,7 @@ public function __construct(LanguageManager $language_manager) { /** * Sets the request on the language manager. * - * @param Symfony\Component\HttpKernel\Event\GetResponseEvent $event + * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * The Event to process. */ public function onKernelRequestLanguage(GetResponseEvent $event) { @@ -59,4 +59,5 @@ static function getSubscribedEvents() { return $events; } + } diff --git a/core/lib/Drupal/Core/Language/LanguageManager.php b/core/lib/Drupal/Core/Language/LanguageManager.php index 737a1c4..6209b3f 100644 --- a/core/lib/Drupal/Core/Language/LanguageManager.php +++ b/core/lib/Drupal/Core/Language/LanguageManager.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\Core\Language\LanguageManager. + * Contains \Drupal\Core\Language\LanguageManager. */ namespace Drupal\Core\Language; @@ -32,7 +32,7 @@ class LanguageManager { /** * Whether or not the language manager has been initialized. * - * @var boolean + * @var bool */ protected $initialized = FALSE; @@ -41,6 +41,8 @@ class LanguageManager { * * @todo This is only needed due to the circular dependency between language * and config. See http://drupal.org/node/1862202 for the plan to fix this. + * + * @var bool */ protected $initializing = FALSE; @@ -88,8 +90,8 @@ public function getLanguage($type) { if ($this->isMultilingual() && $this->request) { if (!$this->initializing) { $this->initializing = TRUE; - // @todo Objectify the language system so that we don't have to do load - // an include file and call out to procedural code. See + // @todo Objectify the language system so that we don't have to load an + // include file and call out to procedural code. See // http://drupal.org/node/1862202 include_once DRUPAL_ROOT . '/core/includes/language.inc'; $this->languages[$type] = language_types_initialize($type, $this->request); @@ -112,9 +114,10 @@ public function getLanguage($type) { /** * Resets the given language type or all types if none specified. * - * @param string $type - * The language type to reset, e.g. LANGUAGE_TYPE_INTERFACE, or NULL to - * reset all language types. + * @param string|null $type + * (optional) The language type to reset as a string, e.g., + * LANGUAGE_TYPE_INTERFACE, or NULL to reset all language types. Defaults to + * NULL. */ public function reset($type = NULL) { if (!isset($type)) { @@ -129,7 +132,7 @@ public function reset($type = NULL) { /** * Returns whether or not the site has more than one language enabled. * - * @return boolean + * @return bool * TRUE if more than one language is enabled, FALSE otherwise. */ protected function isMultilingual() { @@ -162,4 +165,5 @@ protected function getLanguageDefault() { )); return new Language($default_info + array('default' => TRUE)); } + } diff --git a/core/modules/language/language.negotiation.inc b/core/modules/language/language.negotiation.inc index ee977c1..ce0f1dc 100644 --- a/core/modules/language/language.negotiation.inc +++ b/core/modules/language/language.negotiation.inc @@ -206,13 +206,14 @@ function language_from_user($languages) { * @param $languages * An array of valid language objects. * - * @param $request - * The HttpRequest object representing the current request. + * @param \Symfony\Component\HttpFoundation\Request|null $request + * (optional) The HttpRequest object representing the current request. + * Defaults to NULL. * * @return * A valid language code on success, FALSE otherwise. */ -function language_from_user_admin($languages, $request = NULL) { +function language_from_user_admin(array $languages, \Symfony\Component\HttpFoundation\Request $request = NULL) { // User preference (only for authenticated users). global $user; @@ -280,7 +281,7 @@ function language_from_url($languages, $request) { $request_path = urldecode(trim($request->getPathInfo(), '/')); list($language, $path) = language_url_split_prefix($request_path, $languages); - // Store the correct system path, i.e. minus the path prefix. + // Store the correct system path, i.e., minus the path prefix. _language_resolved_path($path); if ($language !== FALSE) { diff --git a/core/modules/locale/lib/Drupal/locale/LocaleBundle.php b/core/modules/locale/lib/Drupal/locale/LocaleBundle.php index f06ce15..4bd8dc0 100644 --- a/core/modules/locale/lib/Drupal/locale/LocaleBundle.php +++ b/core/modules/locale/lib/Drupal/locale/LocaleBundle.php @@ -2,7 +2,7 @@ /** * @file - * Contains LocaleBundle + * Contains \Drupal\locale\LocaleBundle. */ namespace Drupal\locale; @@ -12,7 +12,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; /** - * Bundle for registering locale module's services to the container. + * Registers locale module's services to the container. */ class LocaleBundle extends Bundle {