diff options
author | Felipe Figueroa <amenadiel@gmail.com> | 2021-03-16 10:20:14 +0300 |
---|---|---|
committer | Felipe Figueroa <amenadiel@gmail.com> | 2021-03-16 10:20:14 +0300 |
commit | db612762bed3dae98877bf5920418464ec1e67c6 (patch) | |
tree | ad9029ba71b47aee48cfffa9eb38c1cc37377471 /src/controllers/InfoController.php | |
parent | 978c0359fc0d332f175b6c9af314886dfa77f340 (diff) |
runs rector
Diffstat (limited to 'src/controllers/InfoController.php')
-rw-r--r-- | src/controllers/InfoController.php | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/src/controllers/InfoController.php b/src/controllers/InfoController.php index 2c358991..c55d04d0 100644 --- a/src/controllers/InfoController.php +++ b/src/controllers/InfoController.php @@ -13,6 +13,10 @@ use PHPPgAdmin\Decorators\Decorator; */ class InfoController extends BaseController { + /** + * @var array<string, bool>|mixed + */ + public $shownull; public $controller_title = 'strtables'; /** @@ -22,14 +26,8 @@ class InfoController extends BaseController { $this->printHeader($this->headerTitle('', '', $_REQUEST['table'] . ' - ' . $this->lang['strinfo'])); $this->printBody(); - - switch ($this->action) { - default: - $this->doDefault(); - - break; - } - + $this->doDefault(); + $this->printFooter(); } @@ -304,11 +302,7 @@ class InfoController extends BaseController $total = $tablestatsio->fields['heap_blks_hit'] + $tablestatsio->fields['heap_blks_read']; - if (0 < $total) { - $percentage = \round(($tablestatsio->fields['heap_blks_hit'] / $total) * 100); - } else { - $percentage = 0; - } + $percentage = 0 < $total ? \round(($tablestatsio->fields['heap_blks_hit'] / $total) * 100) : 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; @@ -320,11 +314,7 @@ class InfoController extends BaseController $total = $tablestatsio->fields['idx_blks_hit'] + $tablestatsio->fields['idx_blks_read']; - if (0 < $total) { - $percentage = \round(($tablestatsio->fields['idx_blks_hit'] / $total) * 100); - } else { - $percentage = 0; - } + $percentage = 0 < $total ? \round(($tablestatsio->fields['idx_blks_hit'] / $total) * 100) : 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; @@ -336,11 +326,7 @@ class InfoController extends BaseController $total = $tablestatsio->fields['toast_blks_hit'] + $tablestatsio->fields['toast_blks_read']; - if (0 < $total) { - $percentage = \round(($tablestatsio->fields['toast_blks_hit'] / $total) * 100); - } else { - $percentage = 0; - } + $percentage = 0 < $total ? \round(($tablestatsio->fields['toast_blks_hit'] / $total) * 100) : 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; @@ -352,11 +338,7 @@ class InfoController extends BaseController $total = $tablestatsio->fields['tidx_blks_hit'] + $tablestatsio->fields['tidx_blks_read']; - if (0 < $total) { - $percentage = \round(($tablestatsio->fields['tidx_blks_hit'] / $total) * 100); - } else { - $percentage = 0; - } + $percentage = 0 < $total ? \round(($tablestatsio->fields['tidx_blks_hit'] / $total) * 100) : 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; @@ -455,11 +437,7 @@ class InfoController extends BaseController ) . \PHP_EOL; $total = $indexstatsio->fields['idx_blks_hit'] + $indexstatsio->fields['idx_blks_read']; - if (0 < $total) { - $percentage = \round(($indexstatsio->fields['idx_blks_hit'] / $total) * 100); - } else { - $percentage = 0; - } + $percentage = 0 < $total ? \round(($indexstatsio->fields['idx_blks_hit'] / $total) * 100) : 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; |