summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-14 14:47:55 +0100
committerSimon Rettberg2023-11-14 14:47:55 +0100
commit06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 (patch)
tree7e5493b102074672d8cfd8fe1a61e49f080edbe8 /modules-available/statistics_reporting/page.inc.php
parentUpdate phpstorm config (diff)
downloadslx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.gz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.xz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.zip
Add function param/return types, fix a lot more phpstorm complaints
Diffstat (limited to 'modules-available/statistics_reporting/page.inc.php')
-rw-r--r--modules-available/statistics_reporting/page.inc.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php
index 36081763..ec4bbf1a 100644
--- a/modules-available/statistics_reporting/page.inc.php
+++ b/modules-available/statistics_reporting/page.inc.php
@@ -125,14 +125,14 @@ class Page_Statistics_Reporting extends Page
foreach ($this->COLUMNS as $column) {
$data['columns'][] = array(
'id' => 'col_' . $column,
- 'name' => Dictionary::translateFile('template-tags', 'lang_' . $column, true),
+ 'name' => Dictionary::translateFile('template-tags', 'lang_' . $column),
'checked' => ($forceOn || Request::get('col_' . $column, 'off', 'string') !== 'off') ? 'checked' : '',
);
}
foreach ($this->TABLES as $table) {
$data['tables'][] = array(
- 'name' => Dictionary::translate('table_' . $table, true),
+ 'name' => Dictionary::translate('table_' . $table),
'value' => $table,
'allowed' => User::hasPermission("table.view.$table"),
'selected' => ($this->type === $table) ? 'selected' : '',
@@ -185,12 +185,10 @@ class Page_Statistics_Reporting extends Page
}
Header('Content-Type: application/json; charset=utf-8');
die(json_encode($data));
- } else {
- die('No permission.');
}
- } else {
- echo 'Invalid action.';
+ die('No permission.');
}
+ echo 'Invalid action.';
}
private function doExport()
@@ -257,7 +255,6 @@ class Page_Statistics_Reporting extends Page
}
fclose($fh);
exit();
- break;
case 'xml':
$xml_data = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?><data></data>');
$this->array_to_xml($res, $xml_data, 'row');
@@ -273,9 +270,9 @@ class Page_Statistics_Reporting extends Page
/**
* @param $data array Data to encode
- * @param $xml_data \SimpleXMLElement XML Object to append to
+ * @param $xml_data SimpleXMLElement XML Object to append to
*/
- private function array_to_xml($data, $xml_data, $parentName = 'row')
+ private function array_to_xml(array $data, SimpleXMLElement $xml_data, string $parentName = 'row'): void
{
foreach ($data as $key => $value) {
if (is_numeric($key)) {
@@ -290,7 +287,7 @@ class Page_Statistics_Reporting extends Page
}
}
- private function fetchData($flags)
+ private function fetchData(int $flags)
{
// TODO: Make all modes location-aware, filter while querying, not after
switch ($this->type) {
@@ -316,7 +313,7 @@ class Page_Statistics_Reporting extends Page
// correct indexing of array after deletions
return array_values($data);
case 'client':
- $data = GetData::perClient($flags, Request::any('new', false, 'string'));
+ $data = GetData::perClient($flags);
// only show clients from locations which you have permission for
$filterLocs = User::getAllowedLocations("table.view.client");
foreach ($data as $key => $row) {