dg / bypass-finals

Removes `final` and `readonly` keywords from source code on-the-fly and allows mocking of final methods and classes. It can be used together with any test tool such as PHPUnit or Mockery.
Other
477 stars 30 forks source link

fix: allow using alternative stream handlers (Infection) #33

Closed dkarlovi closed 2 years ago

dkarlovi commented 2 years ago

This is a PR from comments made by @dg and @maks-rafalko in #9. It's confirmed to fix issues with using Infection and BypassFinals together, tested on two of my projects.

dkarlovi commented 2 years ago

Never mind, I've just noticed master branch contains the fix mentioned by @dg and it works even without the patch made by @maks-rafalko. The fix here seems to be to rely on dev-master version until next release. Closing.

maks-rafalko commented 2 years ago

Should be reopened, see https://github.com/dg/bypass-finals/issues/9#issuecomment-1236094916

dmitryuk commented 2 years ago

Is it possible to make testcase?

dkarlovi commented 2 years ago

Agreed, we should try to make one to avoid regressions here. Maybe we register a dummy stream wrapper and then register BypassFinals, would that work?

dkarlovi commented 2 years ago

Alternative fix by @dg merged, closing.