/** * @test */ public function when_deserializing_do_not_call_the_callable_when_the_value_is_null() { $serializedData = ['foo' => null]; $callables = ['foo' => function (array $data) { // when passing null, this would cause a fatal error }]; $this->assertSame($serializedData, RecursiveSerializer::deserialize($serializedData, $callables)); }
/** * @see \Broadway\Serializer\SerializableInterface::deserialize() * * @param array $data * @return object of type static::class */ public static final function deserialize(array $data) { return Reconstitution::reconstitute()->objectFrom(get_called_class(), RecursiveSerializer::deserialize($data, self::deserializationCallbacks())); }