From 099f909c817829477f5a158ce6ad7b3c89c0c710 Mon Sep 17 00:00:00 2001 From: dracony Date: Sat, 31 Oct 2015 23:46:32 +0100 Subject: [PATCH] is_callable instead of method_exists '__invoke' Looks more elegant and as an added bonus $app might now be any callable --- src/React/Espresso/Stack.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/React/Espresso/Stack.php b/src/React/Espresso/Stack.php index 93ac52d..c7a1663 100644 --- a/src/React/Espresso/Stack.php +++ b/src/React/Espresso/Stack.php @@ -22,7 +22,7 @@ public function __construct($app) return new HttpServer($stack['socket']); }); - $isFactory = is_object($app) && method_exists($app, '__invoke'); + $isFactory = is_callable($app); $this['app'] = $isFactory ? $this->protectService($app) : $app; }