EventSaucePHP/ObjectHydrator

Object mapping seems to fail in versions 1.1.1 and above

TristanWeij opened this issue · 1 comments

Hi,

I just updated my dependencies, and noticed that my testsuite started to fail after bumping to version 1.1.2:

- Upgrading eventsauce/object-hydrator (1.0.0 => 1.1.2)

After some research, it seems that the following commit causes an anomaly in src/NaivePropertyTypeResolver.php.

Seems like reintroducing $commentTypeMap[$paramName] = $type; fixes the issue. 🤔

if (str_starts_with($type, '\\') || in_array($type, ['bool', 'boolean', 'int', 'integer', 'float', 'double', 'string', 'array', 'object', 'null'])) {
	$commentTypeMap[$paramName] = $type;
	continue;
}

Hi @TristanWeij, can you supply a case where it fails? Otherwise it's difficult to ensure it won't regress again.