From 4fcbfbc290401006a4c1e4344c0b42c9f884d7c2 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sat, 19 Mar 2022 20:25:07 +0000 Subject: [PATCH] composer.json requires php7.2+ --- src/Nmap/Script.php | 16 +++++++++++++--- src/Nmap/XmlOutputParser.php | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Nmap/Script.php b/src/Nmap/Script.php index 3810398..b671362 100644 --- a/src/Nmap/Script.php +++ b/src/Nmap/Script.php @@ -4,11 +4,21 @@ class Script { - private string $id; - private string $output; + /** + * @var string + */ + private $id; - private array $elems; + /** + * @var string + */ + private $output; + + /** + * @var array + */ + private $elems; public function __construct(string $id, string $output, array $elems) { diff --git a/src/Nmap/XmlOutputParser.php b/src/Nmap/XmlOutputParser.php index 6aa82e0..daab26c 100644 --- a/src/Nmap/XmlOutputParser.php +++ b/src/Nmap/XmlOutputParser.php @@ -19,7 +19,7 @@ public static function parseOutputFile($xmlFile) self::parseAddresses($xmlHost), (string)$xmlHost->status->attributes()->state, isset($xmlHost->hostnames) ? self::parseHostnames($xmlHost->hostnames->hostname) : array(), - isset($xmlHost->ports) ? self::parsePorts($xmlHost->ports->port) : array(), + isset($xmlHost->ports) ? self::parsePorts($xmlHost->ports->port) : array() ); if (isset($xmlHost->hostscript)) { $host->setScripts(self::parseScripts($xmlHost->hostscript->script));