summaryrefslogtreecommitdiffstats
path: root/modules-available/translation
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-02 19:08:58 +0100
committerSimon Rettberg2023-11-02 19:08:58 +0100
commitc2d95ffaeaa289752b4c7b6664b6ca112a02e350 (patch)
tree2c29b0157d14198aadbdbc9f8c18ded0bd4dadcd /modules-available/translation
parent[rebootcontrol] Remove API prototype (diff)
downloadslx-admin-c2d95ffaeaa289752b4c7b6664b6ca112a02e350.tar.gz
slx-admin-c2d95ffaeaa289752b4c7b6664b6ca112a02e350.tar.xz
slx-admin-c2d95ffaeaa289752b4c7b6664b6ca112a02e350.zip
Roundup of issues reported by PHPStorm
Mostly redundant checks, logic errors, dead code, etc.
Diffstat (limited to 'modules-available/translation')
-rw-r--r--modules-available/translation/page.inc.php18
1 files changed, 6 insertions, 12 deletions
diff --git a/modules-available/translation/page.inc.php b/modules-available/translation/page.inc.php
index ee1d2cde..da4205d2 100644
--- a/modules-available/translation/page.inc.php
+++ b/modules-available/translation/page.inc.php
@@ -477,9 +477,8 @@ class Page_Translation extends Page
$tags[$p[1]] = $tag;
}
}
- $tags = $this->loadTagsFromPhp('/Message\s*::\s*add\w+\s*\(\s*[\'"](?<tag>[^\'"\.]*)[\'"]\s*(?<data>\)|\,.*)/i',
+ return $this->loadTagsFromPhp('/Message\s*::\s*add\w+\s*\(\s*[\'"](?<tag>[^\'"\.]*)[\'"]\s*(?<data>\)|\,.*)/i',
$this->getModulePhpFiles($module), $tags);
- return $tags;
}
/**
@@ -510,11 +509,9 @@ class Page_Translation extends Page
return $tags;
}
- private function loadUsedMenuCategories($module = false)
+ private function loadUsedMenuCategories()
{
- if ($module === false) {
- $module = $this->module;
- }
+ $module = $this->module;
$skip = strlen($module->getIdentifier()) + 1;
$match = $module->getIdentifier() . '.';
$want = array();
@@ -740,15 +737,13 @@ class Page_Translation extends Page
private function loadModuleEditArray()
{
$tags = $this->loadUsedModuleTags();
- $table = $this->buildTranslationTable('module', array_keys($tags), true);
- return $table;
+ return $this->buildTranslationTable('module', array_keys($tags), true);
}
private function loadMenuCategoryEditArray()
{
$tags = $this->loadUsedMenuCategories();
- $table = $this->buildTranslationTable('categories', array_keys($tags), true);
- return $table;
+ return $this->buildTranslationTable('categories', array_keys($tags), true);
}
/**
@@ -760,8 +755,7 @@ class Page_Translation extends Page
private function loadCustomEditArray()
{
$tags = $this->loadUsedCustomTags($this->subsection);
- $table = $this->buildTranslationTable($this->subsection, array_keys($tags), true);
- return $table;
+ return $this->buildTranslationTable($this->subsection, array_keys($tags), true);
}
/**