diff --git a/src/JsonMapper.php b/src/JsonMapper.php index 6e5ebac09..5102d9c1a 100644 --- a/src/JsonMapper.php +++ b/src/JsonMapper.php @@ -307,7 +307,7 @@ protected function inspectProperty(ReflectionClass $rc, $name) } // Parameter could not be directly set, so lets go for setter methods - $setter = 'set' . ucfirst($name); + $setter = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $name))); if (!$rc->hasMethod($setter)) { if ($rc->hasProperty($name)) {