public function normalize($object, $format = null, array $context = []) { $data = new \stdClass(); if (null !== $object->getStringProperty()) { $data->{'stringProperty'} = $object->getStringProperty(); } return $data; }