-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Casters for Generator, ReflectionGenerator and ReflectionType #16325
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
Conversation
17bd93e
to
8dd9601
Compare
8dd9601
to
fe88b9f
Compare
f76f986
to
cf4107c
Compare
Status: needs review |
@@ -18,15 +18,17 @@ | |||
*/ | |||
class FrameStub extends EnumStub | |||
{ | |||
public $srcContext; | |||
const DEFAULT_SRC_CONTEXT = 1; |
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.
I thinking about changing this const to a public static so that the default value can be easily changed
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.
-1 for a public static. Mutable global state causes issues.
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.
I still added it because it opens for some flexibility, even if it's global. The component already has some such public static for global configuration. For a dumping tool, that's fine IMO. Default values are overwritable when the default global config is not required.
07b1d8b
to
7cbfd8f
Compare
7cbfd8f
to
d6c2d75
Compare
… and ReflectionType (nicolas-grekas) This PR was merged into the 2.8 branch. Discussion ---------- [VarDumper] Casters for Generator, ReflectionGenerator and ReflectionType | Q | A | ------------- | --- | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - I had this on a local branch since a few days: - on PHP7, using ReflectionGenerator allows dumping interesting state info about generators (see test case for example output) - caster for ReflectionType added - source code excerpts are now left-trimmed (see adjusted test cases) Commits ------- d6c2d75 [VarDumper] Casters for Generator, ReflectionGenerator and ReflectionType
I had this on a local branch since a few days: