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
487 stars 30 forks source link

Fix wrapper for not existing files for file_put_contents operation #10

Closed nightlinus closed 5 years ago

nightlinus commented 5 years ago

When using snapshot testing with bypass-finals we can see that file_put_contents wrapped not correct. This pr fix this by checking for file existance before reading content

dg commented 5 years ago

Thanks. I will modify it to check the mode instead of file existence.

ondrejmirtes commented 4 years ago

I'd like if this fix could be released. Currently bypass-finals breaks PHPStan (because it saves .php files).

dg commented 4 years ago

I completely forgot about it, but it's out.