summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-06-08 23:41:04 (GMT)
committerAlex Pott2014-06-08 23:41:04 (GMT)
commit43324d175255f79b7b95a0949bea24bed766e2d9 (patch)
treec19d904da5267561481b197acae7dc0f9055e2dc
parent978b47c70a5753930e242758f270561d83d06eb9 (diff)
Issue #2080427 by connork, blainelang, harijari, areke, chertzog: Remove Unused local variables from language module.
-rw-r--r--core/modules/language/src/ConfigurableLanguageManager.php2
-rw-r--r--core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php1
-rw-r--r--core/modules/language/src/Tests/LanguageConfigurationTest.php1
-rw-r--r--core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php1
-rw-r--r--core/modules/language/src/Tests/LanguageListTest.php4
-rw-r--r--core/modules/language/src/Tests/LanguageSwitchingTest.php1
-rw-r--r--core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php3
-rw-r--r--core/modules/language/src/Tests/LanguageUrlRewritingTest.php1
8 files changed, 1 insertions, 13 deletions
diff --git a/core/modules/language/src/ConfigurableLanguageManager.php b/core/modules/language/src/ConfigurableLanguageManager.php
index b28e02b..d849691 100644
--- a/core/modules/language/src/ConfigurableLanguageManager.php
+++ b/core/modules/language/src/ConfigurableLanguageManager.php
@@ -319,7 +319,7 @@ class ConfigurableLanguageManager extends LanguageManager implements Configurabl
// Loop locked languages to maintain the existing order.
$locked_languages = $this->getLanguages(Language::STATE_LOCKED);
$config_ids = array_map(function($language) { return 'language.entity.' . $language->id; }, $locked_languages);
- foreach ($this->configFactory->loadMultiple($config_ids) as $config_id => $config) {
+ foreach ($this->configFactory->loadMultiple($config_ids) as $config) {
// Update system languages weight.
$max_weight++;
$config->set('weight', $max_weight);
diff --git a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php
index bdbedc5..4819abf 100644
--- a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php
+++ b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php
@@ -35,7 +35,6 @@ class LanguageNegotiationSelected extends LanguageNegotiationMethodBase {
$langcode = NULL;
if ($this->languageManager) {
- $languages = $this->languageManager->getLanguages();
$langcode = $this->config->get('language.negotiation')->get('selected_langcode');
}
diff --git a/core/modules/language/src/Tests/LanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageConfigurationTest.php
index 6093263..15ccc3d 100644
--- a/core/modules/language/src/Tests/LanguageConfigurationTest.php
+++ b/core/modules/language/src/Tests/LanguageConfigurationTest.php
@@ -34,7 +34,6 @@ class LanguageConfigurationTest extends WebTestBase {
* Functional tests for adding, editing and deleting languages.
*/
function testLanguageConfiguration() {
- global $base_url;
// User to add and remove language.
$admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'administer site configuration'));
diff --git a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php
index 9554dd8..6b4d098 100644
--- a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php
+++ b/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php
@@ -34,7 +34,6 @@ class LanguageCustomLanguageConfigurationTest extends WebTestBase {
* Functional tests for adding, editing and deleting languages.
*/
public function testLanguageConfiguration() {
- global $base_url;
// Create user with permissions to add and remove languages.
$admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages'));
diff --git a/core/modules/language/src/Tests/LanguageListTest.php b/core/modules/language/src/Tests/LanguageListTest.php
index d5abded..9a437a5 100644
--- a/core/modules/language/src/Tests/LanguageListTest.php
+++ b/core/modules/language/src/Tests/LanguageListTest.php
@@ -34,7 +34,6 @@ class LanguageListTest extends WebTestBase {
* Functional tests for adding, editing and deleting languages.
*/
function testLanguageList() {
- global $base_url;
// User to add and remove language.
$admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'administer site configuration'));
@@ -118,12 +117,9 @@ class LanguageListTest extends WebTestBase {
$this->assertResponse(404, 'Language no longer found.');
// Make sure the "language_count" state has been updated correctly.
$this->container->get('language_manager')->reset();
- $languages = $this->container->get('language_manager')->getLanguages();
// Delete French.
$this->drupalPostForm('admin/config/regional/language/delete/fr', array(), t('Delete'));
- // Get the count of languages.
$this->container->get('language_manager')->reset();
- $languages = $this->container->get('language_manager')->getLanguages();
// We need raw here because %language and %langcode will add HTML.
$t_args = array('%language' => 'French', '%langcode' => 'fr');
$this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The French language has been removed.');
diff --git a/core/modules/language/src/Tests/LanguageSwitchingTest.php b/core/modules/language/src/Tests/LanguageSwitchingTest.php
index b4c4616..36607f2 100644
--- a/core/modules/language/src/Tests/LanguageSwitchingTest.php
+++ b/core/modules/language/src/Tests/LanguageSwitchingTest.php
@@ -240,7 +240,6 @@ class LanguageSwitchingTest extends WebTestBase {
*/
protected function doTestLanguageLinkActiveClassAnonymous() {
$function_name = '#type link';
- $path = 'language_test/type-link-active-class';
$this->drupalLogout();
diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
index 1a2e5d6..e828935 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
@@ -90,9 +90,6 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
// For setting browser language preference to some unknown.
$http_header_blah = array("Accept-Language: blah;q=1");
- // This domain should switch the UI to Chinese.
- $language_domain = 'example.cn';
-
// Setup the site languages by installing two languages.
// Set the default language in order for the translated string to be registered
// into database when seen by t(). Without doing this, our target string
diff --git a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
index 39ad3f8..1079031 100644
--- a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
+++ b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
@@ -58,7 +58,6 @@ class LanguageUrlRewritingTest extends WebTestBase {
$non_existing->id = $this->randomName();
$this->checkUrl($non_existing, 'Path language is ignored if language is not installed.', 'URL language negotiation does not work with non-installed languages');
- $request = $this->prepareRequestForGenerator();
// Check that URL rewriting is not applied to subrequests.
$this->drupalGet('language_test/subrequest');
$this->assertText($this->web_user->getUsername(), 'Page correctly retrieved');