Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[PHPUnitBridge] Fix deprecation type detection when trigger_deprecation is used#38013
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
5750b22 to92d4a84Compare| $backtraceTriggerDeprecation =$trace[2] ??null; | ||
| if ($backtraceTriggerDeprecation &&'trigger_deprecation' ===$backtraceTriggerDeprecation['function']) { | ||
| $file =$backtraceTriggerDeprecation['file']; | ||
| unset($trace[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.
can be removed ifarray_values() is removed below, isn't it? that would save some memcopies.
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'm not sure to understand properly.unset is not here because ofarray_values, it'sarray_values that is needed because ofunset. Andunset is needed since if I keep the trace ofdeprecations-contracts/functions.php file,deprecations-contracts/functions.php is considered to determinedirect andindirect deprecations instead of the file that calltrigger_deprecation.
92d4a84 tofd39961Comparenicolas-grekas commentedSep 2, 2020
Thank you@l-vo. |
when trigger_deprecation is used, the deprecation types (self, direct, indirect) are not properly detected because the file where the deprecation come from is always
deprecation-contracts/functions.php. This PR aims to fix that.