From 8aa76a38fe602cea355594019c95a86860513ed1 Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Sun, 25 Aug 2024 09:14:06 -0500 Subject: [PATCH] Fix error message formatting. --- src/Formatter/ArrayBasedDeformatter.php | 2 +- tests/TomlFormatterTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Formatter/ArrayBasedDeformatter.php b/src/Formatter/ArrayBasedDeformatter.php index f3602fd..9705b85 100644 --- a/src/Formatter/ArrayBasedDeformatter.php +++ b/src/Formatter/ArrayBasedDeformatter.php @@ -147,7 +147,7 @@ public function deserializeSequence(mixed $decoded, Field $field, Deserializer $ if ($class->assert($data)) { return $data; } else { - throw TypeMismatch::create($field->serializedName, "array($class->name)", "array(" . \get_debug_type($data[0] . ')')); + throw TypeMismatch::create($field->serializedName, "array($class->name)", "array(" . \get_debug_type($data[0]) . ')'); } } else if (class_exists($class) || interface_exists($class)) { diff --git a/tests/TomlFormatterTest.php b/tests/TomlFormatterTest.php index e47cfda..38bbabb 100644 --- a/tests/TomlFormatterTest.php +++ b/tests/TomlFormatterTest.php @@ -108,7 +108,7 @@ protected function empty_values_validate(mixed $serialized): void self::assertEquals('boop', $toTest['withDefault']); self::assertArrayNotHasKey('nullableUninitialized', $toTest); self::assertArrayNotHasKey('uninitialized', $toTest); - self::assertNull($toTest['roNullable']); + self::assertArrayNotHasKey('roNullable', $toTest); } protected function arrayify(mixed $serialized): array