diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..663510f --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +parameters: + level: 1 + paths: + - src + - tools + +# vim: set noexpandtab ts=4 sw=2: nolist # diff --git a/src/Ipaddresses.php b/src/Ipaddresses.php index 572a06d..d731058 100644 --- a/src/Ipaddresses.php +++ b/src/Ipaddresses.php @@ -311,6 +311,7 @@ class Ipaddresses $e[count($e) - 1] = "0"; } $s = 8 - count($e); + $newipv6 = []; foreach ($e as $key => $val) { if ($val === "") { for ($i = 0; $i <= $s; $i++) { diff --git a/src/Logger.php b/src/Logger.php index 8fd58f9..96a0a0f 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -72,14 +72,16 @@ class Logger * LOG_INFO informational message * LOG_DEBUG debug-level message */ - private $priorities = [LOG_EMERG => "EMERG", - LOG_ALERT => "ALERT", - LOG_CRIT => "CRITICAL", - LOG_ERR => "ERROR", - LOG_WARNING => "WARNING", - LOG_NOTICE => "NOTICE", - LOG_INFO => "INFO", - LOG_DEBUG => "DEBUG"]; + private $priorities = [ + LOG_EMERG => "EMERG", + LOG_ALERT => "ALERT", + LOG_CRIT => "CRITICAL", + LOG_ERR => "ERROR", + LOG_WARNING => "WARNING", + LOG_NOTICE => "NOTICE", + LOG_INFO => "INFO", + LOG_DEBUG => "DEBUG", + ]; /** * Catch all the messages raised by the PHP, in trigger_error @@ -103,6 +105,7 @@ class Logger // This error code is not included in error_reporting return; } + $priority = LOG_ERR; switch ($errno) { case E_ERROR: $priority = LOG_ERR; @@ -111,7 +114,7 @@ class Logger $priority = LOG_WARNING; break; case E_PARSE: - $priority = LOG_PARSE; + $priority = LOG_ERR; break; case E_NOTICE: $priority = LOG_NOTICE; @@ -225,6 +228,7 @@ class Logger if ($this->loglevelmin < $priority) { return; } + $back = []; $backtrace = debug_backtrace(); for ($i = 0; $i <= $this->backTraceSkip; $i++) { $back = array_shift($backtrace); @@ -271,6 +275,7 @@ class Logger $msg .= "\n" . ($e->getTraceAsString()); } + $logsType = []; if (is_string($this->logtype)) { $logsType = explode("|", $this->logtype); } elseif (is_array($this->logtype)) { diff --git a/src/Queue.php b/src/Queue.php index 3d45ba0..a54f305 100644 --- a/src/Queue.php +++ b/src/Queue.php @@ -53,6 +53,7 @@ class Queue */ public function getAll() { + return []; } /** @@ -100,5 +101,6 @@ class Queue */ public function getRange($start, $number, $delete = false) { + return []; } } diff --git a/src/Renderer.php b/src/Renderer.php index c941838..87c5efc 100644 --- a/src/Renderer.php +++ b/src/Renderer.php @@ -153,6 +153,7 @@ class Renderer $dataflash = ""; if (isset($_SESSION["renderer"]["flash"])) { foreach ($_SESSION["renderer"]["flash"] as $flash) { + $alert = ""; $dataflash .= "
ipv6, $this->ipv4); } + $errno = -1; + $errstr = ""; foreach ($ips as $ip) { if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $ip = "[$ip]"; diff --git a/src/Xdiff.php b/src/Xdiff.php index 3392b81..799e89d 100644 --- a/src/Xdiff.php +++ b/src/Xdiff.php @@ -531,6 +531,7 @@ class Xdiff { $found1 = false; $found2 = false; + $tmp1 = $tmp2 = -1; while ($i < count($array1)) { $tmp2 = $j; while ($tmp2 < count($array2)) { diff --git a/tools/modelGraph.php b/tools/modelGraph.php index ad850de..4ddb004 100755 --- a/tools/modelGraph.php +++ b/tools/modelGraph.php @@ -178,5 +178,5 @@ if (! isset($argv[3])) { if (! isset($argv[4])) { die("No output file provided\n"); } -$modelgraph = new modelgraph($argv[1], $argv[2], $argv[3], $argv[4]); +$modelgraph = new Modelgraph($argv[1], $argv[2], $argv[3], $argv[4]); $modelgraph->generate(); diff --git a/tools/sqlMigrate.php b/tools/sqlMigrate.php index d015f7c..56b9f0e 100755 --- a/tools/sqlMigrate.php +++ b/tools/sqlMigrate.php @@ -101,7 +101,7 @@ class Main if (! file_exists($configurationFile)) { touch($configurationFile); } - $config = new Domframework\Configuration(); + $config = new Configuration(); $config->confFile = $configurationFile; $db = $config->get("db"); @@ -400,7 +400,7 @@ class Main } try { - $main = new \main(); + $main = new \Main(); } catch (Exception $e) { file_put_contents("php://stderr", $e->getMessage() . "\n"); exit(4);