JsonCodec: fix ${var} deprecation notice in error message

Change-Id: I55c86098f4fae8a2e686e48cb74c4fbd3530ce51
This commit is contained in:
C. Scott Ananian 2024-10-16 01:50:54 -04:00
parent 1f7b364be1
commit 8409b9ebd3

View file

@ -171,11 +171,11 @@ class JsonCodec
if ( is_a( $got, $expectedClass, true ) ) {
// Everything ok!
} else {
throw new JsonException( "Expected ${expectedClass} got ${got}" );
throw new JsonException( "Expected {$expectedClass} got {$got}" );
}
} else {
$got = get_debug_type( $json );
throw new JsonException( "Expected ${expectedClass} got ${got}" );
throw new JsonException( "Expected {$expectedClass} got {$got}" );
}
}
try {
@ -184,7 +184,7 @@ class JsonCodec
throw new JsonException( $e->getMessage() );
}
if ( $expectedClass && !is_a( $result, $expectedClass, false ) ) {
throw new JsonException( "Unexpected class: ${expectedClass}" );
throw new JsonException( "Unexpected class: {$expectedClass}" );
}
return $result;
}