venomous0x/WhatsAPI — pull request #631 by rafitaFCB (2014-03-18 02:53:07+00:00)
Title: Add toString method to ProtocolNode class

This change is very helpful when using the events and want to print this object or convert it to JSON format.

For example:

```php
/**
* Event fired when was get an error
*
* @param string $phone
* @param \WhatsApi\Nodes\ProtocolNode $error
*/
public function onGetError(
$phone,
$error
)
{
$result = array(
'sender' => $phone,
'error' => (string)$error //Casting to force object conversion to string
);

echo json_encode( $result );
}