cleanup function/parameters and add type declarations where possible

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-02-07 11:15:19 +01:00
parent c3f769d48b
commit 464663877c
31 changed files with 928 additions and 651 deletions

View File

@@ -30,10 +30,19 @@ use Froxlor\Database\Database;
class FroxlorVhostSettings
{
public static function hasVhostContainerEnabled($need_ssl = false)
/**
* @param bool $need_ssl
*
* @return bool
* @throws \Exception
*/
public static function hasVhostContainerEnabled(bool $need_ssl = false): bool
{
$sel_stmt = Database::prepare("SELECT COUNT(*) as vcentries FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `vhostcontainer`= '1'" . ($need_ssl ? " AND `ssl` = '1'" : ""));
$result = Database::pexecute_first($sel_stmt);
return $result['vcentries'] > 0;
if ($result) {
return $result['vcentries'] > 0;
}
return false;
}
}