diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9e809591..3a8baca9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,7 +1,72 @@ parameters: ignoreErrors: - - message: "#^Parameter \\#1 \\$result of function pg_result_error expects resource, object\\|resource\\|true given\\.$#" + message: "#^Parameter \\#1 \\$connection of function pg_connection_busy expects PgSql\\\\Connection, object\\|resource given\\.$#" + count: 3 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$connection of function pg_connection_status expects PgSql\\\\Connection, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$connection of function pg_get_result expects PgSql\\\\Connection, object\\|resource given\\.$#" + count: 2 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$connection of function pg_meta_data expects PgSql\\\\Connection, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$connection of function pg_send_query expects PgSql\\\\Connection, object\\|resource given\\.$#" + count: 2 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$connection of function pg_socket expects PgSql\\\\Connection, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$connection of function pg_version expects PgSql\\\\Connection\\|null, object\\|resource given\\.$#" + count: 2 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$result of function pg_affected_rows expects PgSql\\\\Result, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$result of function pg_fetch_all expects PgSql\\\\Result, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$result of function pg_fetch_array expects PgSql\\\\Result, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$result of function pg_field_name expects PgSql\\\\Result, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$result of function pg_num_fields expects PgSql\\\\Result, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$result of function pg_num_rows expects PgSql\\\\Result, object\\|resource given\\.$#" + count: 1 + path: www/lib/CoreLibs/DB/SQL/PgSQL.php + + - + message: "#^Parameter \\#1 \\$result of function pg_result_error expects PgSql\\\\Result, object\\|resource given\\.$#" count: 1 path: www/lib/CoreLibs/DB/SQL/PgSQL.php diff --git a/phpstan.neon b/phpstan.neon index b5976e7c..16f0117f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -24,7 +24,9 @@ parameters: # do not check old qq file uploader tests - www/admin/qq_file_upload_*.php # ignore all test files - - www/admin/class_test*php + - www/admin/class_test*.php + # extra in sub folder + - www/admin/subfolder/class_test*.php - www/admin/error_test.php # admin synlink files - www/admin/edit_*.php @@ -47,9 +49,12 @@ parameters: - www/vendor # ignore errores with ignoreErrors: - - # this error is ignore because of the PHP 8.0 to 8.1 change for pg_* + - # this error is ignore because of the PHP 8.0 to 8.1 change for pg_*, only for 8.0 or lower message: "#^Parameter \\#1 \\$(result|connection) of function pg_\\w+ expects resource(\\|null)?, object\\|resource(\\|bool)? given\\.$#" path: %currentWorkingDirectory%/www/lib/CoreLibs/DB/SQL/PgSQL.php + - # this is for 8.1 or newer + message: "#^Parameter \\#1 \\$(result|connection) of function pg_\\w+ expects PgSql\\\\(Result|Connection(\\|null)?), object\\|resource given\\.$#" + path: %currentWorkingDirectory%/www/lib/CoreLibs/DB/SQL/PgSQL.php # this is ignored for now # - '#Expression in empty\(\) is always falsy.#' # - diff --git a/www/admin/class_test.system.php b/www/admin/class_test.system.php index bed402f5..dfd1f25b 100644 --- a/www/admin/class_test.system.php +++ b/www/admin/class_test.system.php @@ -42,7 +42,6 @@ $log = new CoreLibs\Debug\Logging([ 'echo_all' => $ECHO_ALL ?? false, 'print_all' => $PRINT_ALL ?? false, ]); -$basic = new CoreLibs\Basic($log); print ""; print "