Skip to content

Conversation

@maximetassy
Copy link
Contributor

@maximetassy maximetassy commented Sep 26, 2024

Description

Method \Illuminate\Database\Eloquent\Concerns\PreventsCircularRecursion::withoutRecursion() will crash if it is invoked from eval.

That happens because \Illuminate\Support\Onceable::tryFromTrace() will return null when the second frame in the trace stack is eval.

A more appropriate example is when the \Illuminate\Database\Eloquent\Model::toArray() method is called on a model mocked by mockery/mockery.

close issue #52727

@maximetassy maximetassy changed the title Fix crash of method PreventsCircularRecursion::withoutRecursion() on mocked models [11.x] Fix crash of method PreventsCircularRecursion::withoutRecursion() on mocked models Sep 26, 2024
@taylorotwell taylorotwell merged commit ef9113e into laravel:11.x Sep 27, 2024
31 checks passed
@maximetassy maximetassy deleted the mocked-model-circular-recursion branch September 27, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants