summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbash.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbash.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbash.inc.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbash.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbash.inc.php
index 86b2931f..d6b542ec 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbash.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbash.inc.php
@@ -3,39 +3,39 @@
class ScriptBuilderBash extends ScriptBuilderBase
{
- public function output($string)
+ public function output(string $string): void
{
echo $string;
}
- public function bootstrapLive() { return false; }
+ public function bootstrapLive(): bool { return false; }
- public function getMenu(IPxeMenu $menu, bool $bootstrap)
+ public function getMenu(IPxeMenu $menu, bool $bootstrap): string
{
return $this->menuToScript($menu);
}
- public function getBootEntry($entry)
+ public function getBootEntry(?BootEntry $entry): string
{
- if (!$entry) {
+ if ($entry === null) {
return "echo 'Invalid boot entry id'\nread -n1 -r _\n";
}
return $entry->toScript($this);
}
- public function getMenuEntry($entry, $honorPassword = true)
+ public function getMenuEntry(?MenuEntry $entry, bool $honorPassword = true): string
{
if ($entry === null)
return "echo 'Invalid menu entry id - press any key to continue'\nread -n1 -r _\n";
return $entry->getBootEntryScript($this);
}
- public function getSpecial($special)
+ public function getSpecial(string $special): string
{
return ''; // We can't really do localboot here I guess
}
- public function menuToScript($menu)
+ public function menuToScript(IPxeMenu $menu): string
{
$output = "declare -A items_name items_gap hotkey_item\ndeclare menu_default menu_timeout menu_title\n";
foreach ($menu->items as $entry) {
@@ -59,7 +59,7 @@ class ScriptBuilderBash extends ScriptBuilderBase
. "\nmenu_title=" . $this->bashString($menu->title) . "\n";
}
- public function execDataToScript($agnostic, $bios, $efi) : string
+ public function execDataToScript(?ExecData $agnostic, ?ExecData $bios, ?ExecData $efi): string
{
if ($agnostic !== null)
return $this->execDataToScriptInternal($agnostic);
@@ -86,7 +86,7 @@ class ScriptBuilderBash extends ScriptBuilderBase
return $script;
}
- private function bashString($string)
+ private function bashString(string $string): string
{
if (strpos($string, "'") === false) {
return "'$string'";