Roave/BetterReflection

Detection of trait use circular references

herndlm opened this issue · 3 comments

Defining a trait, using itself and also using it in a class leads to endless recursion when methods, properties or constants are queried from the class.
Most likely other circular-trait-usages like a->b->a or so lead to the same.

I should be able to open a PR for this on the weekend the latest. I just created this issue because I was a bit worried since it looks like 6.0 is coming soon :) but I guess this shouldn't be a BC break anyways, would still nice to have it in though

Most likely I'll refactor the way trait hierarchies are collected and then add circular reference protection. Should I split the changes in 2 PRs?

@herndlm I think one PR is ok - maybe two commits. However if the refactoring is needed to implement the circular reference check then one commit should be ok too.

I made some refactoring yesterday too.

Handled in #1253, #1254, #1256