phpstan l1 (incomplete)
This commit is contained in:
7
phpstan.neon
Normal file
7
phpstan.neon
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
parameters:
|
||||||
|
level: 1
|
||||||
|
paths:
|
||||||
|
- src
|
||||||
|
- tools
|
||||||
|
|
||||||
|
# vim: set noexpandtab ts=4 sw=2: nolist #
|
||||||
@@ -311,6 +311,7 @@ class Ipaddresses
|
|||||||
$e[count($e) - 1] = "0";
|
$e[count($e) - 1] = "0";
|
||||||
}
|
}
|
||||||
$s = 8 - count($e);
|
$s = 8 - count($e);
|
||||||
|
$newipv6 = [];
|
||||||
foreach ($e as $key => $val) {
|
foreach ($e as $key => $val) {
|
||||||
if ($val === "") {
|
if ($val === "") {
|
||||||
for ($i = 0; $i <= $s; $i++) {
|
for ($i = 0; $i <= $s; $i++) {
|
||||||
|
|||||||
@@ -72,14 +72,16 @@ class Logger
|
|||||||
* LOG_INFO informational message
|
* LOG_INFO informational message
|
||||||
* LOG_DEBUG debug-level message
|
* LOG_DEBUG debug-level message
|
||||||
*/
|
*/
|
||||||
private $priorities = [LOG_EMERG => "EMERG",
|
private $priorities = [
|
||||||
LOG_ALERT => "ALERT",
|
LOG_EMERG => "EMERG",
|
||||||
LOG_CRIT => "CRITICAL",
|
LOG_ALERT => "ALERT",
|
||||||
LOG_ERR => "ERROR",
|
LOG_CRIT => "CRITICAL",
|
||||||
LOG_WARNING => "WARNING",
|
LOG_ERR => "ERROR",
|
||||||
LOG_NOTICE => "NOTICE",
|
LOG_WARNING => "WARNING",
|
||||||
LOG_INFO => "INFO",
|
LOG_NOTICE => "NOTICE",
|
||||||
LOG_DEBUG => "DEBUG"];
|
LOG_INFO => "INFO",
|
||||||
|
LOG_DEBUG => "DEBUG",
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Catch all the messages raised by the PHP, in trigger_error
|
* 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
|
// This error code is not included in error_reporting
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$priority = LOG_ERR;
|
||||||
switch ($errno) {
|
switch ($errno) {
|
||||||
case E_ERROR:
|
case E_ERROR:
|
||||||
$priority = LOG_ERR;
|
$priority = LOG_ERR;
|
||||||
@@ -111,7 +114,7 @@ class Logger
|
|||||||
$priority = LOG_WARNING;
|
$priority = LOG_WARNING;
|
||||||
break;
|
break;
|
||||||
case E_PARSE:
|
case E_PARSE:
|
||||||
$priority = LOG_PARSE;
|
$priority = LOG_ERR;
|
||||||
break;
|
break;
|
||||||
case E_NOTICE:
|
case E_NOTICE:
|
||||||
$priority = LOG_NOTICE;
|
$priority = LOG_NOTICE;
|
||||||
@@ -225,6 +228,7 @@ class Logger
|
|||||||
if ($this->loglevelmin < $priority) {
|
if ($this->loglevelmin < $priority) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$back = [];
|
||||||
$backtrace = debug_backtrace();
|
$backtrace = debug_backtrace();
|
||||||
for ($i = 0; $i <= $this->backTraceSkip; $i++) {
|
for ($i = 0; $i <= $this->backTraceSkip; $i++) {
|
||||||
$back = array_shift($backtrace);
|
$back = array_shift($backtrace);
|
||||||
@@ -271,6 +275,7 @@ class Logger
|
|||||||
$msg .= "\n" . ($e->getTraceAsString());
|
$msg .= "\n" . ($e->getTraceAsString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$logsType = [];
|
||||||
if (is_string($this->logtype)) {
|
if (is_string($this->logtype)) {
|
||||||
$logsType = explode("|", $this->logtype);
|
$logsType = explode("|", $this->logtype);
|
||||||
} elseif (is_array($this->logtype)) {
|
} elseif (is_array($this->logtype)) {
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class Queue
|
|||||||
*/
|
*/
|
||||||
public function getAll()
|
public function getAll()
|
||||||
{
|
{
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,5 +101,6 @@ class Queue
|
|||||||
*/
|
*/
|
||||||
public function getRange($start, $number, $delete = false)
|
public function getRange($start, $number, $delete = false)
|
||||||
{
|
{
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ class Renderer
|
|||||||
$dataflash = "";
|
$dataflash = "";
|
||||||
if (isset($_SESSION["renderer"]["flash"])) {
|
if (isset($_SESSION["renderer"]["flash"])) {
|
||||||
foreach ($_SESSION["renderer"]["flash"] as $flash) {
|
foreach ($_SESSION["renderer"]["flash"] as $flash) {
|
||||||
|
$alert = "";
|
||||||
$dataflash .= "<div class='alert ";
|
$dataflash .= "<div class='alert ";
|
||||||
switch ($flash[0]) {
|
switch ($flash[0]) {
|
||||||
case 4:
|
case 4:
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ class RouteSQL
|
|||||||
} else {
|
} else {
|
||||||
if (isset($_SESSION["renderer"]["flash"])) {
|
if (isset($_SESSION["renderer"]["flash"])) {
|
||||||
foreach ($_SESSION["renderer"]["flash"] as $flash) {
|
foreach ($_SESSION["renderer"]["flash"] as $flash) {
|
||||||
|
$alert = "";
|
||||||
$dataflash .= "<div class='alert ";
|
$dataflash .= "<div class='alert ";
|
||||||
switch ($flash[0]) {
|
switch ($flash[0]) {
|
||||||
case 4:
|
case 4:
|
||||||
|
|||||||
@@ -184,6 +184,8 @@ class Tcpclient
|
|||||||
} else {
|
} else {
|
||||||
$ips = array_merge($this->ipv6, $this->ipv4);
|
$ips = array_merge($this->ipv6, $this->ipv4);
|
||||||
}
|
}
|
||||||
|
$errno = -1;
|
||||||
|
$errstr = "";
|
||||||
foreach ($ips as $ip) {
|
foreach ($ips as $ip) {
|
||||||
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||||
$ip = "[$ip]";
|
$ip = "[$ip]";
|
||||||
|
|||||||
@@ -531,6 +531,7 @@ class Xdiff
|
|||||||
{
|
{
|
||||||
$found1 = false;
|
$found1 = false;
|
||||||
$found2 = false;
|
$found2 = false;
|
||||||
|
$tmp1 = $tmp2 = -1;
|
||||||
while ($i < count($array1)) {
|
while ($i < count($array1)) {
|
||||||
$tmp2 = $j;
|
$tmp2 = $j;
|
||||||
while ($tmp2 < count($array2)) {
|
while ($tmp2 < count($array2)) {
|
||||||
|
|||||||
@@ -178,5 +178,5 @@ if (! isset($argv[3])) {
|
|||||||
if (! isset($argv[4])) {
|
if (! isset($argv[4])) {
|
||||||
die("No output file provided\n");
|
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();
|
$modelgraph->generate();
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class Main
|
|||||||
if (! file_exists($configurationFile)) {
|
if (! file_exists($configurationFile)) {
|
||||||
touch($configurationFile);
|
touch($configurationFile);
|
||||||
}
|
}
|
||||||
$config = new Domframework\Configuration();
|
$config = new Configuration();
|
||||||
$config->confFile = $configurationFile;
|
$config->confFile = $configurationFile;
|
||||||
|
|
||||||
$db = $config->get("db");
|
$db = $config->get("db");
|
||||||
@@ -400,7 +400,7 @@ class Main
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$main = new \main();
|
$main = new \Main();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
file_put_contents("php://stderr", $e->getMessage() . "\n");
|
file_put_contents("php://stderr", $e->getMessage() . "\n");
|
||||||
exit(4);
|
exit(4);
|
||||||
|
|||||||
Reference in New Issue
Block a user