-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[PHPUnitBridge] Static access in closure #29724
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
[PHPUnitBridge] Static access in closure #29724
Conversation
|
Doing many commits for now, in case some of them cannot be merged. Will squash if everything is all good. |
8df51b1 to
e90bfef
Compare
|
Prepended the commit list with one cs-fix commit (self accessor), apparently the code wasn't even valid before any changes. Got rid of the fabbot commit by dispatching changes to the right commits. |
e90bfef to
5345897
Compare
|
The Travis failure seems unrelated. |
5345897 to
2584634
Compare
17417bb to
b7100b3
Compare
|
The build failures are unrelated, please review again @nicolas-grekas |
1a12b1c to
79921b3
Compare
|
rebase needed please, but before, I'd recommend you to squash+apply move to short arrays. |
79921b3 to
7bee301
Compare
| } | ||
|
|
||
| $UtilPrefix = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_' : 'PHPUnit\Util\\'; | ||
| self::computeMode($mode); |
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.
Computing the mode should be kept lazy: it allows registering the bridge and configure the mode a bit later before any deprecation is thrown. That's an important behavior we should keep.
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.
Ok, I introduced a new $rawMode static to keep the value until it is necessary to compute the actual mode.
7bee301 to
9df76eb
Compare
|
I pushed a 2nd commit here, that uses an internal instance instead of static properties to track the state. |
29f3e54 to
97f3023
Compare
|
Thank you @greg0ire. |
…las-grekas) This PR was merged into the 4.3-dev branch. Discussion ---------- [PHPUnitBridge] Static access in closure | Q | A | ------------- | --- | Branch? | master for features | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n / a | License | MIT | Doc PR | n / a #29718 bumps php to 5.5 . This is what we could simplify if it gets merged, thanks to this "new" PHP feature: https://3v4l.org/sJOWr EDIT: it was merged, this can be reviewed. Commits ------- 97f3023 Use the scope of an instance 9df76eb Extract closures into static functions
#29718 bumps php to 5.5 . This is what we could simplify if it gets merged, thanks to this "new" PHP feature: https://3v4l.org/sJOWr
EDIT: it was merged, this can be reviewed.