From 367c6f7d2c6bac6983d5156d9e85af1bbb70b9e8 Mon Sep 17 00:00:00 2001 From: tracer Date: Wed, 26 Jan 2022 19:35:14 +0100 Subject: [PATCH] added missing named parameters, added strict_types Signed-off-by: tracer --- src/Controller/BindAPI.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Controller/BindAPI.php b/src/Controller/BindAPI.php index cb81d85..9ede6ac 100755 --- a/src/Controller/BindAPI.php +++ b/src/Controller/BindAPI.php @@ -145,6 +145,7 @@ class BindAPI /** * @param String $domain * + * @return bool|void */ function checkNS(String $domain) { @@ -165,9 +166,9 @@ class BindAPI type: 'nameserver' . $domain); } if ($result['header'] == 200) { - echo COLOR_GREEN . ' OK'; + return true; } else { - echo COLOR_RED . ' missing'; + return false; } } echo PHP_EOL; @@ -207,7 +208,7 @@ class BindAPI foreach ($domains as $domain) { if ($domain->id_parent_domain == 0 && !str_contains(haystack: $domain->domain, needle: $panel['name'])) { echo PHP_EOL . COLOR_DEFAULT . "check: " . COLOR_YELLOW . str_pad(string: $domain->domain, length: $maxDomainName); - if ($this->checkNS($domain->domain)) { + if ($this->checkNS(domain: $domain->domain)) { echo COLOR_GREEN . ' OK'; } else { echo COLOR_RED . 'Missing'; @@ -791,9 +792,10 @@ class BindAPI { $arguments = $this->parseArguments(); - $id = $this->arguments[1] ?? 0; + $id = intval(value: $this->arguments[1] ?? 0); $name = $arguments['name'] ?? ''; print_r(value: $arguments); //findme + print("$id: id" . PHP_EOL); $panelID = intval(value: $arguments['panel_id'] ?? 0); $a = $arguments['a'] ?? ''; $aaaa = $arguments['aaaa'] ?? '';