From 9182e606f2f971530aff13dbbf2289f54b5f5bcc Mon Sep 17 00:00:00 2001 From: Alexander Diachenko Date: Thu, 7 Mar 2019 11:56:34 +0200 Subject: [PATCH] Allow alternative constructor arguments notation in ServeFeaturesTrait --- src/ServesFeaturesTrait.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ServesFeaturesTrait.php b/src/ServesFeaturesTrait.php index a7d2ff9..802e4b5 100644 --- a/src/ServesFeaturesTrait.php +++ b/src/ServesFeaturesTrait.php @@ -20,6 +20,10 @@ trait ServesFeaturesTrait */ public function serve($feature, $arguments = []) { - return $this->dispatch($this->marshal($feature, new Collection(), $arguments)); + if (!is_object($feature)) { + return $this->dispatch($this->marshal($feature, new Collection(), $arguments)); + } else { + return $this->dispatch($feature, $arguments); + } } }