Closed
Description
I noticed that the GetSetMethodNormalizer
that comes with Serializer doesn't support toggling the detection and conversion of underscores from all fields provided.
I've mitigated this by creating my own subclass as follows:
class GetSetMethodNormalizer extends Base {
protected function formatAttribute($attributeName) {
return preg_replace_callback(
'/(^|_|\.)+(.)/',
function ($match) {
return ('.' === $match[1] ? '_' : '') . strtoupper($match[2]);
},
$attributeName
);
}
}
This appears to have handled things so far, but I'm wondering if it might be nice to formalize this as a setting in GetSetMethodNormalizer
?