Skip to content

Commit

Permalink
Replace setter check to support testing mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHash authored Mar 28, 2017
1 parent 9244352 commit 184c6f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Common/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 184c6f0

Please sign in to comment.