私はこのコードを持っています:
$latest_PG_notice = pg_last_notice($database_connection);
if ($latest_PG_notice && is_string($latest_PG_notice))
trigger_error('"' . $latest_PG_notice . '"'); // This line is wrong according to PHPStan.
PHPStan は次のエラーを報告します。
二項演算「.」'"' と non-empty-array|non-empty-string|true の間はエラーになります。
なぜこれが起こっているのかわかりません。pg_last_notice
他の条件が設定されている場合、ブール値または配列を返すこともできますが、is_string
チェックがあるため、PHPStan はこれが文字列であることを認識している必要があります。