From 184c6f053e2455707bb572385a9d8ecb6be2b655 Mon Sep 17 00:00:00 2001 From: Hasham Ahmad Date: Tue, 28 Mar 2017 12:05:20 +0100 Subject: [PATCH] Replace setter check to support testing mocks --- src/Common/Object.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/Object.php b/src/Common/Object.php index d39188a..81c57d6 100644 --- a/src/Common/Object.php +++ b/src/Common/Object.php @@ -29,7 +29,7 @@ public function __construct(array $state = []) //$camelcased_property = lcfirst($studly_property_name); $setter_method = 'set' . ucfirst($studly_property_name); - if (is_callable([$this, $setter_method])) { + if (method_exists($this, $setter_method)) { $this->$setter_method($property_value); } elseif (property_exists($this, $property_name)) { $this->$property_name = $property_value;