Skip to content

Commit 4251050

Browse files
author
Alexander Miertsch
authored
Merge pull request #6 from event-engine/fix/reflection_deprication
Fix deprecation message for reflection type
2 parents 814838d + da9ea08 commit 4251050

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/ImmutableRecordLogic.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,19 @@ private static function buildPropTypeMap()
277277
continue;
278278
}
279279

280+
if (! $prop->hasType()) {
281+
throw new \RuntimeException(
282+
\sprintf(
283+
'Missing type hint for property %s of record %s',
284+
$prop->getName(),
285+
__CLASS__
286+
)
287+
);
288+
}
289+
280290
$type = $prop->getType();
281291

282-
$propTypeMap[$prop->getName()] = [(string) $type, self::isScalarType((string) $type), $type->allowsNull()];
292+
$propTypeMap[$prop->getName()] = [$type->getName(), self::isScalarType($type->getName()), $type->allowsNull()];
283293
}
284294

285295
return $propTypeMap;

0 commit comments

Comments
 (0)