Skip to content

Commit

Permalink
Check for a string first to pass the condition quicker
Browse files Browse the repository at this point in the history
  • Loading branch information
David Yell committed Oct 16, 2018
1 parent 56786c7 commit 6318d68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/Behavior/DuplicatableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ protected function _doAction($action, EntityInterface $entity, $prop, $value = n
break;

case 'set':
if (is_callable($value) && !is_string($value)) {
if (!is_string($value) && is_callable($value)) {
$value = $value($entity);
}
$entity->set($prop, $value);
Expand Down

0 comments on commit 6318d68

Please sign in to comment.