Skip to content

Commit

Permalink
Fix attribute handler detection
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Jun 22, 2023
1 parent c03ab67 commit d3a0310
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Import/Hydrators/AttributeHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ protected function getSyncAttributes(): array
*/
protected function isAttributeHandler(mixed $value): bool
{
return is_callable($value) || class_exists($value)
&& (method_exists($value, '__invoke') || method_exists($value, 'handle'));
if ($value instanceof Closure) {
return true;
}

return class_exists($value) && (method_exists($value, '__invoke') || method_exists($value, 'handle'));
}
}

0 comments on commit d3a0310

Please sign in to comment.