Two PHP 8.5 deprecation warnings still fire from Spanner/src/ValueMapper.php on every Spanner call that binds parameters.
Locations
On current main (v2.6.1):
1. paramType() — L430
if (isset(self::$typeCodes[$givenType])) {
$givenType defaults to null and callers also pass null, triggering:
Using null as an array offset is deprecated, use an empty string instead
2. isCustomType() — L892
private static function isCustomType(string|null $type): bool
{
return array_key_exists($type, self::$typeToClassMap);
}
The signature accepts string|null, but null goes straight to array_key_exists():
Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead
Suggested Fix
Add null-guards:
// paramType()
if ($givenType !== null && isset(self::$typeCodes[$givenType])) {
// isCustomType()
return $type !== null && array_key_exists($type, self::$typeToClassMap);
Environment
- PHP 8.5.5
- google/cloud-spanner v2.6.1 /
main
Two PHP 8.5 deprecation warnings still fire from
Spanner/src/ValueMapper.phpon every Spanner call that binds parameters.Locations
On current
main(v2.6.1):1.
paramType()— L430$givenTypedefaults tonulland callers also passnull, triggering:2.
isCustomType()— L892The signature accepts
string|null, butnullgoes straight toarray_key_exists():Suggested Fix
Add null-guards:
Environment
main