Skip to content

Commit d55b183

Browse files
vrananicolas-grekas
authored andcommitted
[VarDumper] Avoid deprecated call in PgSqlCaster
1 parent 13b873f commit d55b183

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Caster/PgSqlCaster.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\VarDumper\Cloner\Stub;
1515

1616
/**
17-
* Casts pqsql resources to array representation.
17+
* Casts pgsql resources to array representation.
1818
*
1919
* @author Nicolas Grekas <[email protected]>
2020
*
@@ -142,9 +142,9 @@ public static function castResult($result, array $a, Stub $stub, bool $isNested)
142142
'name' => pg_field_name($result, $i),
143143
'table' => sprintf('%s (OID: %s)', pg_field_table($result, $i), pg_field_table($result, $i, true)),
144144
'type' => sprintf('%s (OID: %s)', pg_field_type($result, $i), pg_field_type_oid($result, $i)),
145-
'nullable' => (bool) pg_field_is_null($result, $i),
145+
'nullable' => (bool) (\PHP_VERSION_ID >= 80300 ? pg_field_is_null($result, null, $i) : pg_field_is_null($result, $i)),
146146
'storage' => pg_field_size($result, $i).' bytes',
147-
'display' => pg_field_prtlen($result, $i).' chars',
147+
'display' => (\PHP_VERSION_ID >= 80300 ? pg_field_prtlen($result, null, $i) : pg_field_prtlen($result, $i)).' chars',
148148
];
149149
if (' (OID: )' === $field['table']) {
150150
$field['table'] = null;

0 commit comments

Comments
 (0)