Skip to content

Commit

Permalink
fix: infinite recursion in mixins middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Jul 18, 2018
1 parent 774f11c commit b5a4317
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Middlewares/Mixins.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public function getMixinsFromClass(Broker $broker, ClassReflection $classReflect
->get('larastan.mixins')[$classReflection->getName()] ?? []
);

$mixins = array_filter($mixins, function ($mixin) use ($classReflection) {
return (new \ReflectionClass($mixin))->getName() !== $classReflection->getName();
});

if (! empty($mixins)) {
foreach ($mixins as $mixin) {
$mixins = array_merge($mixins, $this->getMixinsFromClass($broker, $broker->getClass($mixin)));
Expand Down

0 comments on commit b5a4317

Please sign in to comment.