beyondcode / beyondcode/laravel-query-detector

debug_backtrace limit

Open
#48 2 comments 1 reaction 0 assignees View on GitHub
good first issue
Dominant language
PHP
Stars
2.1k
Forks
144
PR merge metrics
No merged PRs in 30d

Description

Is there a special reason why the `debug_backtrace()` `limit` was set to `50`?

https://github.com/beyondcode/laravel-query-detector/blob/c39994e813aa50c3f4168dc872546d7318bfebc5/src/QueryDetector.php#L25

I am in a situation where I am implementing recursive relationships and at a certain depth the following line throws an `ErrorException (E_NOTICE)` (`Undefined offset: 0`):

https://github.com/beyondcode/laravel-query-detector/blob/c39994e813aa50c3f4168dc872546d7318bfebc5/src/QueryDetector.php#L77

Increasing the `debug_backtrace()` `limit` makes the notice disappear (at least to a certain depth). Would it be possible to make the limit configurable/disableable or is there a better approach that I don't see right now?

Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.