I've run into an issue with the unserialize signature:

  /**
   * Unserializes submitted data.
   *
   * @param string $data
   *  The encoded data
   *
   * @return object
   *   The unserialized data as a PHP object.
   *
   * @throws Webhook_Plugins_Unserializer_InvalidDataException
   */
  public function unserialize($data);

The unserialize method returns an object.

For the Webhook_Plugins_Unserializer_UrlEncoded implementation the unserialize method returns an array.

Could you please clarify how this is meant to work. Personally I think that it would be beneficial to loosen up the return value so that different processors can pick what is most natural for them. Certainly an array is the most natural for "urlencoded".

In the meantime I will loosen up my processor to be forgiving in what it accepts, ie. not restrict it to StdClass.

Comments

skwashd’s picture

Status: Active » Fixed

Thanks for the bug report. The return types are now always stdClass. This was implemented in a recent commit.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.