Skip to content

Released version 1.11.0

Latest

Choose a tag to compare

@dg dg released this 24 Jul 12:26
· 1 commit to master since this release

BypassFinals now understands modern PHP: final disappears not only from classes and methods, but also from properties and property hooks introduced in PHP 8.4. Caching got safer and smarter, path matching finally behaves on Windows, and PHPUnit users can configure path masks straight from phpunit.xml.

💥PHP 8.2

  • PHP 8.2 is now the minimum. Support for PHP 7.1–8.1 has been dropped. If you're stuck on an older PHP, stay on 1.10.x.

✨ New Features

  • final is now removed from properties and property hooks (PHP 8.4+), not just from classes and methods. The rule is inverted: final survives only before constants, where it's a genuine feature rather than a mockability barrier.
  • PHPUnit extension learned allowPaths and denyPaths – restrict which files get rewritten without touching a single line of PHP. Semicolon-separated masks, right there in phpunit.xml:
    <parameter name="allowPaths" value="*/src/*;*/lib/*"/>
    <parameter name="denyPaths" value="*/generated/*"/>
  • debugInfo() now shows the full picture – allowed and denied path rules plus the cache directory, so you can see at a glance why a file wasn't modified.

🐛 Bug Fixes

  • final readonly int $x no longer produces invalid code. With both bypasses enabled it used to emit a bare int $x; a property must keep at least one modifier, so the first removed one now becomes public.
  • Path masks match case-insensitively on Windows, where C:/Src/ and c:/src/ are the same directory – as they always should have been.
  • Cache files are written atomically via a temp file and rename(), so a process killed mid-write can no longer leave a truncated file behind and poison every subsequent run. [#80]
  • Stale caches invalidate themselves. The cache key now includes the algorithm version and the PHP version, so upgrading PHP or BypassFinals no longer serves you code rewritten by the old rules.