Skip to content
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

phpdbg_*() functions are scoped to PHPUnit\phpdbg_*() #4211

Closed
sebastianbergmann opened this issue May 8, 2020 · 8 comments
Closed

phpdbg_*() functions are scoped to PHPUnit\phpdbg_*() #4211

sebastianbergmann opened this issue May 8, 2020 · 8 comments
Assignees
Labels

Comments

@sebastianbergmann
Copy link
Owner

PHP-Scoper, for example, transforms this line

if (!\function_exists('phpdbg_start_oplog')) {

to

if (!\function_exists('PHPUnit\\phpdbg_start_oplog')) {

which, of course, does not work properly anymore.

@sebastianbergmann
Copy link
Owner Author

@theofidry @sebastianfeldmann How do we fix this? Is this something missing on PHPUnit's side (as in how we use PHP-Scoper) or is this a problem in PHP-Scoper (as in it should know that phpdbg_*() functions are built into PHP)?

@theofidry
Copy link
Contributor

There is two solutions for it:

Those two are not mutually exclusive, just potentially redundant.

Also note that there is a discussion to allow this part to be directly configurable from the config (see humbug/php-scoper#303 (comment)) which would make it even faster to patch (as a workaround – it doesn't prevent having to patch upstream for a "cleaner" solution)

@theofidry
Copy link
Contributor

Ah right, meanwhile the 3rd quick & dirty alternative is to leverage the patchers to replace the incorrect replacements

@sebastianbergmann
Copy link
Owner Author

I have created pull requests for both php-scoper and phpstorm-stubs which (hopefully) teach these two about the phpdbg_*() functions. I would rather not use a patcher (that I have to remove later) to address this problem.

@theofidry
Copy link
Contributor

👍 will try to go through my OSS notifs tomorrow

@sebastianbergmann
Copy link
Owner Author

JetBrains/phpstorm-stubs#793 has been merged.

@sebastianbergmann
Copy link
Owner Author

@theofidry Any update on this? Thanks!

@theofidry
Copy link
Contributor

Should be fixed in 0.13.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants