-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One reflector to rule them all #772
Conversation
c8d4480
to
004a5ea
Compare
This is PoC of big BC break :) Motivation: <?php
namespace Foo;
const SOME_CONSTANT = 0;
class Boo
{
public function method($parameter = SOME_CONSTANT)
{}
} It's not possible with I propose to have one It can also improve the types. There are a lot of places where current interface I've also removed the ugly circular reference in https://github.com/Roave/BetterReflection/blob/5.0.x/src/BetterReflection.php#L89 There's one class |
@Ocramius Please look at this PR (when you have time) and tell me if it will be mergeable :) If yes, please also add the opinion about the names :) I’ll then make the build green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concept here seems fine; there is a finite number of "types of symbols to reflect on" so growth is reasonably controlled, I think our concern originally (why we split into ClassReflector
/FunctionReflector
) is uncertainty over how many symbol types we'd want to reflect about. Now the library is much more defined, it seems reasonable.
I do also like that it solves the circular dependency issue 👍
I'd say keep the interface named |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kukulich from my PoV, approach is very much valid! It's a major BC break, but easy to migrate to it
@Ocramius what do you think about the names of interface and the class? |
f458d40
to
febf1c6
Compare
2b78ad1
to
002c15d
Compare
@kukulich
|
c5cd412
to
7cec9a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last change needed :D
one reflector to find them one reflector to bring them all and in the reflection bind them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Awesome, thanks @kukulich! |
One reflector to rule them all
one reflector to find them
one reflector to bring them all
and in the reflection bind them