Skip to content

Commit 22fdb0d

Browse files
author
Mantas Marcinkevicius
committed
minor fixes to serialization
1 parent 1b9ec8a commit 22fdb0d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Mapping/Converter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ public function addClassMetadata(string $class, array $metadata): void
2828
public function convertArrayToDocument(string $namespace, array $raw)
2929
{
3030
if (!isset($this->propertyMetadata[$namespace])) {
31-
echo json_encode($raw, JSON_PRETTY_PRINT);
32-
33-
return [];
31+
throw new \Exception("Cannot convert array to object of class `$class`.");
3432
}
3533

3634
return $this->denormalize($raw, $namespace);

Mapping/DocumentParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private function guessGetter(\ReflectionClass $class, $name): string
287287
}
288288

289289
if ($class->hasMethod('is' . ucfirst($name))) {
290-
return 'get' . ucfirst($name);
290+
return 'is' . ucfirst($name);
291291
}
292292

293293
throw new \Exception("Could not determine a getter for `$name` of class `{$class->getNamespaceName()}`");

0 commit comments

Comments
 (0)