public function hydrate(MessageInterface $message, array $data)
    {
        foreach ($data as $key => $value) {
            $setter = 'set' . ucfirst($key);

            if (!method_exists($message, $setter)) {
                throw new \RuntimeException(sprintf('Unable to found setter for "%s" data key', $key));
            }

            $message->$setter($value);
        }

        return $message;
    }
public function hydrate(MessageInterface $message, array $data)
    {
        foreach ($data as $key => $value) {
            $setter = 'set' . ucfirst($key);

            if (!method_exists($message, $setter)) {
                throw new \RuntimeException(sprintf('Unable to found setter for "%s" data key', $key));
            }

            $message->$setter($value);
        }

        return $message;
    }
public function hydrate ( MessageInterface $ message , array $ data ) { foreach ( $ data as $ key => $ value ) { $ setter = 'set' . ucfirst ( $ key ) ; if ( ! method_exists ( $ message , $ setter ) ) { throw new \ RuntimeException ( sprintf ( 'Unable to found setter for "%s" data key' , $ key ) ) ; } $ message -> $ setter ( $ value ) ; } return $ message ; }
Hydrate a Message with data

@param MessageInterface $message
@param array            $data

@return MessageInterface
Hydrate a Message with data