Ignore errors in DB\SQL\PgSQL for phpstan

phpstan will throw an error because pg_* methods have changed from
resource to object in php 8.1
So current var has object|resource dual type and this will fail
Added ignore for phpstan in the config file.
Also added conditional config file for phpstan where we can set based on
current active PHP version
baseline file created with --generate-baseline is added for error check
This commit is contained in:
Clemens Schwaighofer
2022-01-20 13:09:02 +09:00
parent 2a697817fd
commit 6a139d3b7c
5 changed files with 63 additions and 25 deletions

7
phpstan-baseline.neon Normal file
View File

@@ -0,0 +1,7 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$result of function pg_result_error expects resource, object\\|resource\\|true given\\.$#"
count: 1
path: www/lib/CoreLibs/DB/SQL/PgSQL.php