src/Normalizer/ExplicitNormalizer.php
public function normalize($object, $format = null, array $context = [])
    {
        if (!$object instanceof AbstractExplicitMessage) {
            throw new InvalidArgumentException();
        }

        $reflection = new ReflectionClass($object);

        $args = [];

        foreach ($reflection->getProperties() as $property) {
            $property->setAccessible(true);

            $args[$property->getName()] = $property->getValue($object);
        }

        return $args;
    }
public function normalize($object, $format = null, array $context = [])
    {
        if (!$object instanceof AbstractExplicitMessage) {
            throw new InvalidArgumentException();
        }

        $reflection = new ReflectionClass($object);

        $args = [];

        foreach ($reflection->getProperties() as $property) {
            $property->setAccessible(true);

            $args[$property->getName()] = $property->getValue($object);
        }

        return $args;
    }
{@inheritdoc}

@throws \InvalidArgumentException