Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorffflabs <amenadiel@gmail.com>2020-02-26 10:38:15 +0300
committerffflabs <amenadiel@gmail.com>2020-02-26 11:30:00 +0300
commit2b72a6599564901461c9c537e641b58f9fe8cd62 (patch)
tree5c6a62375a7e0456938792564f64b3b54d0626cc /src/controllers/InfoController.php
parent55f8d1b0a09c9f90eec93e1737f524ecd809ff61 (diff)
adding psalm linting
fine tuning of git files restoring tests fixes tests after refactoring fine tuning for psalm baseline
Diffstat (limited to 'src/controllers/InfoController.php')
-rw-r--r--src/controllers/InfoController.php280
1 files changed, 143 insertions, 137 deletions
diff --git a/src/controllers/InfoController.php b/src/controllers/InfoController.php
index 3d4a31a6..2e1f6a60 100644
--- a/src/controllers/InfoController.php
+++ b/src/controllers/InfoController.php
@@ -1,7 +1,10 @@
<?php
+// declare(strict_types=1);
+
/**
- * PHPPgAdmin v6.0.0-RC9
+ * PHPPgAdmin vv6.0.0-RC8-16-g13de173f
+ *
*/
namespace PHPPgAdmin\Controller;
@@ -10,8 +13,6 @@ use PHPPgAdmin\Decorators\Decorator;
/**
* Base controller class.
- *
- * @package PHPPgAdmin
*/
class InfoController extends BaseController
{
@@ -20,9 +21,9 @@ class InfoController extends BaseController
/**
* Default method to render the controller according to the action parameter.
*/
- public function render()
+ public function render(): void
{
- $this->printHeader($this->headerTitle('', '', $_REQUEST['table'].' - '.$this->lang['strinfo']));
+ $this->printHeader($this->headerTitle('', '', $_REQUEST['table'] . ' - ' . $this->lang['strinfo']));
$this->printBody();
switch ($this->action) {
@@ -63,53 +64,53 @@ class InfoController extends BaseController
$indexstatsio = $data->getStatsIndexIO($_REQUEST['table']);
// Check that there is some info
- if (($referrers === -99 || ($referrers !== -99 && 0 == $referrers->recordCount()))
- && 0 == $parents->recordCount() && 0 == $children->recordCount()
- && (0 == $tablestatstups->recordCount() && 0 == $tablestatsio->recordCount()
- && 0 == $indexstatstups->recordCount() && 0 == $indexstatsio->recordCount())) {
+ if ((-99 === $referrers || (-99 !== $referrers && 0 === $referrers->recordCount()))
+ && 0 === $parents->recordCount() && 0 === $children->recordCount()
+ && (0 === $tablestatstups->recordCount() && 0 === $tablestatsio->recordCount()
+ && 0 === $indexstatstups->recordCount() && 0 === $indexstatsio->recordCount())) {
$this->printMsg($this->lang['strnoinfo']);
return;
}
// Referring foreign tables
- if ($referrers !== -99 && $referrers->recordCount() > 0) {
+ if (-99 !== $referrers && 0 < $referrers->recordCount()) {
$this->_printReferring($referrers);
}
// Parent tables
- if ($parents->recordCount() > 0) {
+ if (0 < $parents->recordCount()) {
$this->_printParents($parents);
}
// Child tables
- if ($children->recordCount() > 0) {
+ if (0 < $children->recordCount()) {
$this->_printChildren($children);
}
// Row performance
- if ($tablestatstups->recordCount() > 0) {
+ if (0 < $tablestatstups->recordCount()) {
$this->_printTablestatstups($tablestatstups);
}
// I/O performance
- if ($tablestatsio->recordCount() > 0) {
+ if (0 < $tablestatsio->recordCount()) {
$this->_printTablestatsio($tablestatsio);
}
// Index row performance
- if ($indexstatstups->recordCount() > 0) {
+ if (0 < $indexstatstups->recordCount()) {
$this->_printIndexstatstups($indexstatstups);
}
// Index I/0 performance
- if ($indexstatsio->recordCount() > 0) {
+ if (0 < $indexstatsio->recordCount()) {
$this->_printIndexstatsio($indexstatsio);
}
}
- private function _printChildren($children)
+ private function _printChildren($children): void
{
- echo "<h3>{$this->lang['strchildtables']}</h3>".PHP_EOL;
+ echo "<h3>{$this->lang['strchildtables']}</h3>" . \PHP_EOL;
$columns = [
'schema' => [
@@ -143,193 +144,198 @@ class InfoController extends BaseController
echo $this->printTable($children, $columns, $actions, 'info-children', $this->lang['strnodata']);
}
- private function _printTablestatstups($tablestatstups)
+ private function _printTablestatstups($tablestatstups): void
{
- echo "<h3>{$this->lang['strrowperf']}</h3>".PHP_EOL;
-
- echo '<table>'.PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"2\">{$this->lang['strsequential']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"2\">{$this->lang['strindex']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strrows2']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strread']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strfetch']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strinsert']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strupdate']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdelete']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
+ echo "<h3>{$this->lang['strrowperf']}</h3>" . \PHP_EOL;
+
+ echo '<table>' . \PHP_EOL;
+ echo "\t<tr>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"2\">{$this->lang['strsequential']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"2\">{$this->lang['strindex']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strrows2']}</th>" . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
+ echo "\t<tr>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strread']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strfetch']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strinsert']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strupdate']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdelete']}</th>" . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
$i = 0;
while (!$tablestatstups->EOF) {
- $id = (0 == ($i % 2) ? '1' : '2');
- echo "\t<tr class=\"data{$id}\">".PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['seq_scan'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['seq_tup_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['idx_scan'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['idx_tup_fetch'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_ins'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_upd'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_del'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t</tr>".PHP_EOL;
+ $id = (0 === ($i % 2) ? '1' : '2');
+ echo "\t<tr class=\"data{$id}\">" . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['seq_scan'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['seq_tup_read'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['idx_scan'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['idx_tup_fetch'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_ins'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_upd'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatstups->fields['n_tup_del'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
$tablestatstups->movenext();
++$i;
}
- echo '</table>'.PHP_EOL;
+ echo '</table>' . \PHP_EOL;
}
- private function _printTablestatsio($tablestatsio)
+ private function _printTablestatsio($tablestatsio): void
{
- echo "<h3>{$this->lang['strioperf']}</h3>".PHP_EOL;
-
- echo '<table>'.PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strheap']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strindex']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strtoast']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strtoastindex']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
+ echo "<h3>{$this->lang['strioperf']}</h3>" . \PHP_EOL;
+
+ echo '<table>' . \PHP_EOL;
+ echo "\t<tr>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strheap']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strindex']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strtoast']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$this->lang['strtoastindex']}</th>" . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
+ echo "\t<tr>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>" . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
$i = 0;
while (!$tablestatsio->EOF) {
- $id = (0 == ($i % 2) ? '1' : '2');
- echo "\t<tr class=\"data{$id}\">".PHP_EOL;
+ $id = (0 === ($i % 2) ? '1' : '2');
+ echo "\t<tr class=\"data{$id}\">" . \PHP_EOL;
$total = $tablestatsio->fields['heap_blks_hit'] + $tablestatsio->fields['heap_blks_read'];
- if ($total > 0) {
- $percentage = round(($tablestatsio->fields['heap_blks_hit'] / $total) * 100);
+
+ if (0 < $total) {
+ $percentage = \round(($tablestatsio->fields['heap_blks_hit'] / $total) * 100);
} else {
$percentage = 0;
}
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['heap_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['heap_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['heap_blks_read'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['heap_blks_hit'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>" . \PHP_EOL;
$total = $tablestatsio->fields['idx_blks_hit'] + $tablestatsio->fields['idx_blks_read'];
- if ($total > 0) {
- $percentage = round(($tablestatsio->fields['idx_blks_hit'] / $total) * 100);
+
+ if (0 < $total) {
+ $percentage = \round(($tablestatsio->fields['idx_blks_hit'] / $total) * 100);
} else {
$percentage = 0;
}
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['idx_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['idx_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['idx_blks_read'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['idx_blks_hit'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>" . \PHP_EOL;
$total = $tablestatsio->fields['toast_blks_hit'] + $tablestatsio->fields['toast_blks_read'];
- if ($total > 0) {
- $percentage = round(($tablestatsio->fields['toast_blks_hit'] / $total) * 100);
+
+ if (0 < $total) {
+ $percentage = \round(($tablestatsio->fields['toast_blks_hit'] / $total) * 100);
} else {
$percentage = 0;
}
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['toast_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['toast_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['toast_blks_read'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['toast_blks_hit'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>" . \PHP_EOL;
$total = $tablestatsio->fields['tidx_blks_hit'] + $tablestatsio->fields['tidx_blks_read'];
- if ($total > 0) {
- $percentage = round(($tablestatsio->fields['tidx_blks_hit'] / $total) * 100);
+
+ if (0 < $total) {
+ $percentage = \round(($tablestatsio->fields['tidx_blks_hit'] / $total) * 100);
} else {
$percentage = 0;
}
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['tidx_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['tidx_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['tidx_blks_read'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($tablestatsio->fields['tidx_blks_hit'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>" . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
$tablestatsio->movenext();
++$i;
}
- echo '</table>'.PHP_EOL;
+ echo '</table>' . \PHP_EOL;
}
- private function _printIndexstatstups($indexstatstups)
+ private function _printIndexstatstups($indexstatstups): void
{
- echo "<h3>{$this->lang['stridxrowperf']}</h3>".PHP_EOL;
-
- echo '<table>'.PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strindex']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strread']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strfetch']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
+ echo "<h3>{$this->lang['stridxrowperf']}</h3>" . \PHP_EOL;
+
+ echo '<table>' . \PHP_EOL;
+ echo "\t<tr>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strindex']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strscan']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strread']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strfetch']}</th>" . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
$i = 0;
while (!$indexstatstups->EOF) {
- $id = (0 == ($i % 2) ? '1' : '2');
- echo "\t<tr class=\"data{$id}\">".PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['indexrelname']), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_scan'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_tup_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_tup_fetch'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t</tr>".PHP_EOL;
+ $id = (0 === ($i % 2) ? '1' : '2');
+ echo "\t<tr class=\"data{$id}\">" . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['indexrelname']), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_scan'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_tup_read'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatstups->fields['idx_tup_fetch'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
$indexstatstups->movenext();
++$i;
}
- echo '</table>'.PHP_EOL;
+ echo '</table>' . \PHP_EOL;
}
- private function _printIndexstatsio($indexstatsio)
+ private function _printIndexstatsio($indexstatsio): void
{
- echo "<h3>{$this->lang['stridxioperf']}</h3>".PHP_EOL;
-
- echo '<table>'.PHP_EOL;
- echo "\t<tr>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strindex']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>".PHP_EOL;
- echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
+ echo "<h3>{$this->lang['stridxioperf']}</h3>" . \PHP_EOL;
+
+ echo '<table>' . \PHP_EOL;
+ echo "\t<tr>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strindex']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strdisk']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strcache']}</th>" . \PHP_EOL;
+ echo "\t\t<th class=\"data\">{$this->lang['strpercent']}</th>" . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
$i = 0;
while (!$indexstatsio->EOF) {
- $id = (0 == ($i % 2) ? '1' : '2');
- echo "\t<tr class=\"data{$id}\">".PHP_EOL;
+ $id = (0 === ($i % 2) ? '1' : '2');
+ echo "\t<tr class=\"data{$id}\">" . \PHP_EOL;
$total = $indexstatsio->fields['idx_blks_hit'] + $indexstatsio->fields['idx_blks_read'];
- if ($total > 0) {
- $percentage = round(($indexstatsio->fields['idx_blks_hit'] / $total) * 100);
+
+ if (0 < $total) {
+ $percentage = \round(($indexstatsio->fields['idx_blks_hit'] / $total) * 100);
} else {
$percentage = 0;
}
- echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['indexrelname']), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['idx_blks_read'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['idx_blks_hit'], 'int4', $this->shownull), '</td>'.PHP_EOL;
- echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>".PHP_EOL;
- echo "\t</tr>".PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['indexrelname']), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['idx_blks_read'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>", $this->misc->printVal($indexstatsio->fields['idx_blks_hit'], 'int4', $this->shownull), '</td>' . \PHP_EOL;
+ echo "\t\t<td>({$percentage}{$this->lang['strpercent']})</td>" . \PHP_EOL;
+ echo "\t</tr>" . \PHP_EOL;
$indexstatsio->movenext();
++$i;
}
- echo '</table>'.PHP_EOL;
+ echo '</table>' . \PHP_EOL;
}
- private function _printParents($parents)
+ private function _printParents($parents): void
{
- echo "<h3>{$this->lang['strparenttables']}</h3>".PHP_EOL;
+ echo "<h3>{$this->lang['strparenttables']}</h3>" . \PHP_EOL;
$columns = [
'schema' => [
@@ -363,9 +369,9 @@ class InfoController extends BaseController
echo $this->printTable($parents, $columns, $actions, 'info-parents', $this->lang['strnodata']);
}
- private function _printReferring($referrers)
+ private function _printReferring($referrers): void
{
- echo "<h3>{$this->lang['strreferringtables']}</h3>".PHP_EOL;
+ echo "<h3>{$this->lang['strreferringtables']}</h3>" . \PHP_EOL;
$columns = [
'schema' => [