Loading core/lib/Drupal/Core/Language/LanguageManager.php +1 −1 Original line number Diff line number Diff line Loading @@ -215,7 +215,7 @@ public function getFallbackCandidates(array $context = []) { * {@inheritdoc} */ public function getLanguageSwitchLinks($type, Url $url) { return []; return NULL; } /** Loading core/lib/Drupal/Core/Language/LanguageManagerInterface.php +5 −2 Original line number Diff line number Diff line Loading @@ -171,8 +171,11 @@ public function getFallbackCandidates(array $context = []); * @param \Drupal\Core\Url $url * The URL the switch links will be relative to. * * @return array * A keyed array of links ready to be themed. * @return object|null * An object with the following keys: * - links: An array of links indexed by the language ID * - method_id: The language negotiation method ID * or NULL if there are no language switch links. */ public function getLanguageSwitchLinks($type, Url $url); Loading core/modules/language/src/ConfigurableLanguageManager.php +1 −3 Original line number Diff line number Diff line Loading @@ -403,8 +403,6 @@ public function getFallbackCandidates(array $context = []) { * {@inheritdoc} */ public function getLanguageSwitchLinks($type, Url $url) { $links = FALSE; if ($this->negotiator) { foreach ($this->negotiator->getNegotiationMethods($type) as $method_id => $method) { $reflector = new \ReflectionClass($method['class']); Loading @@ -422,7 +420,7 @@ public function getLanguageSwitchLinks($type, Url $url) { } } return $links; return $links ?? NULL; } /** Loading Loading
core/lib/Drupal/Core/Language/LanguageManager.php +1 −1 Original line number Diff line number Diff line Loading @@ -215,7 +215,7 @@ public function getFallbackCandidates(array $context = []) { * {@inheritdoc} */ public function getLanguageSwitchLinks($type, Url $url) { return []; return NULL; } /** Loading
core/lib/Drupal/Core/Language/LanguageManagerInterface.php +5 −2 Original line number Diff line number Diff line Loading @@ -171,8 +171,11 @@ public function getFallbackCandidates(array $context = []); * @param \Drupal\Core\Url $url * The URL the switch links will be relative to. * * @return array * A keyed array of links ready to be themed. * @return object|null * An object with the following keys: * - links: An array of links indexed by the language ID * - method_id: The language negotiation method ID * or NULL if there are no language switch links. */ public function getLanguageSwitchLinks($type, Url $url); Loading
core/modules/language/src/ConfigurableLanguageManager.php +1 −3 Original line number Diff line number Diff line Loading @@ -403,8 +403,6 @@ public function getFallbackCandidates(array $context = []) { * {@inheritdoc} */ public function getLanguageSwitchLinks($type, Url $url) { $links = FALSE; if ($this->negotiator) { foreach ($this->negotiator->getNegotiationMethods($type) as $method_id => $method) { $reflector = new \ReflectionClass($method['class']); Loading @@ -422,7 +420,7 @@ public function getLanguageSwitchLinks($type, Url $url) { } } return $links; return $links ?? NULL; } /** Loading