From 590fb71e3493b5daba382c44f714f2e25d785814 Mon Sep 17 00:00:00 2001 From: drewm Date: Sat, 23 Apr 2016 13:43:28 +0100 Subject: [PATCH] Better error checking --- src/Webhook.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Webhook.php b/src/Webhook.php index be70133..a2ad7eb 100644 --- a/src/Webhook.php +++ b/src/Webhook.php @@ -11,7 +11,7 @@ class Webhook { private static $eventSubscriptions = array(); - private static $receivedWebhook = false; + private static $receivedWebhook = null; /** * Subscribe to an incoming webhook request. The callback will be invoked when a matching webhook is received. @@ -35,7 +35,7 @@ public static function subscribe($event, callable $callback) public static function receive($input = null) { if (is_null($input)) { - if (self::$receivedWebhook !== false) { + if (self::$receivedWebhook !== null) { $input = self::$receivedWebhook; } else { $input = file_get_contents("php://input");