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
22 lines
444 B
PHP
22 lines
444 B
PHP
<?php
|
|
|
|
// conditional formats for PHP versions
|
|
|
|
declare(strict_types=1);
|
|
|
|
$config = [];
|
|
|
|
if (PHP_VERSION_ID >= 8_00_00) {
|
|
// Change of signature in PHP 8.1
|
|
/* $config['parameters']['ignoreErrors'][] = [
|
|
'message' => '~Parameter #1 \$(result|connection) of function pg_\w+ '
|
|
. 'expects resource(\|null)?, object\|resource given\.~',
|
|
'path' => 'www/lib/CoreLibs/DB/SQL/PgSQL.php',
|
|
// 'count' => 1,
|
|
]; */
|
|
}
|
|
|
|
return $config;
|
|
|
|
// __END_
|