PHPackages                             avto-dev/bypass-finals - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. avto-dev/bypass-finals

Abandoned → [dg/bypass-finals](/?search=dg%2Fbypass-finals)ArchivedLibrary[Testing &amp; Quality](/categories/testing)

avto-dev/bypass-finals
======================

Removes final keyword from source code on-the-fly and allows mocking of final methods and classes

v1.2.0(6y ago)02.7kBSD-3-ClausePHPPHP &gt;=5.6

Since Sep 13Pushed 5y agoCompare

[ Source](https://github.com/avto-dev/bypass-finals)[ Packagist](https://packagist.org/packages/avto-dev/bypass-finals)[ RSS](/packages/avto-dev-bypass-finals/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (0)

 [![](https://camo.githubusercontent.com/a343790ed0b233ece692be18fa2e784a7c7626bb04dc7e2e59a5e1af697ce723/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f69636f6e732f656d6f6a692f756e69636f64652f323661302e706e67)](https://camo.githubusercontent.com/a343790ed0b233ece692be18fa2e784a7c7626bb04dc7e2e59a5e1af697ce723/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f69636f6e732f656d6f6a692f756e69636f64652f323661302e706e67) **This package is abandoned and no longer maintained** [![](https://camo.githubusercontent.com/a343790ed0b233ece692be18fa2e784a7c7626bb04dc7e2e59a5e1af697ce723/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f69636f6e732f656d6f6a692f756e69636f64652f323661302e706e67)](https://camo.githubusercontent.com/a343790ed0b233ece692be18fa2e784a7c7626bb04dc7e2e59a5e1af697ce723/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f69636f6e732f656d6f6a692f756e69636f64652f323661302e706e67)
 We suggests using the original [dg/bypass-finals](https://github.com/dg/bypass-finals) package instead
 *since v1.2.0 it includes all changes from this fork*

Bypass Finals
=============

[](#bypass-finals)

[![Version](https://camo.githubusercontent.com/09758800a2624f46180e00941598e55311e40da2fd8ab84a971eaf95d5a035ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6176746f2d6465762f6279706173732d66696e616c732e7376673f6d61784167653d313830)](https://packagist.org/packages/avto-dev/bypass-finals)[![Version](https://camo.githubusercontent.com/9997bb8ff454a1feb5bf761fd9324ed96b70df36ec90dbf0014d18cceab47144/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6176746f2d6465762f6279706173732d66696e616c732e7376673f6c6f6e6743616368653d74727565)](https://packagist.org/packages/avto-dev/bypass-finals)[![Build Status](https://camo.githubusercontent.com/3f97a215364609c1aa8c2c91bc6c5ce3730949707313502c357bea11b11b9fd4/68747470733a2f2f7472617669732d63692e6f72672f6176746f2d6465762f6279706173732d66696e616c732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/avto-dev/bypass-finals)[![Downloads count](https://camo.githubusercontent.com/5a183b1c5072b69313cc4d33e5e3ca6a6cf9c7b8aaf17d3c63fd69699a3f248a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6176746f2d6465762f6279706173732d66696e616c732e7376673f6d61784167653d313830)](https://packagist.org/packages/avto-dev/bypass-finals)[![License](https://camo.githubusercontent.com/6fd67de3683ec2b90a715b6162677274334a1fc24bf9219df812264d42479066/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6176746f2d6465762f6279706173732d66696e616c732e7376673f6c6f6e6743616368653d74727565)](https://github.com/avto-dev/bypass-finals/blob/master/LICENSE)

Introduction
------------

[](#introduction)

Removes final 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, Mockery or [Nette Tester](https://tester.nette.org).

Installation
------------

[](#installation)

The recommended way to install is through Composer:

```
composer require --dev avto-dev/bypass-finals "^1.2"
```

> Installed `composer` is required ([how to install composer](https://getcomposer.org/download/)).

> You need to fix the major version of package.

It requires PHP version 5.6 and supports PHP up to 7.3.

Usage
-----

[](#usage)

Simply call this:

```
DG\BypassFinals::enable();
```

You need to enable it before the classes you want to remove the final are loaded. So call it as soon as possible, preferably right after `vendor/autoload.php` in loaded.

You can choose to only bypass finals in specific files:

```
DG\BypassFinals::setWhitelist([
    'relative/path/to/file.php'
]);

DG\BypassFinals::enable();
```

This gives you finer control and can solve issues with certain frameworks and libraries.

If you like it, **[please make a donation now](https://nette.org/make-donation?to=bypass-finals)**. Thank you!

Changes log
-----------

[](#changes-log)

[![Release date](https://camo.githubusercontent.com/06e612c2ab06ade28cbfaeef0120aa0f17ccd5dd8e0b08e693808b225b3e4380/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f6176746f2d6465762f6279706173732d66696e616c732e7376673f7374796c653d666c61742d737175617265266d61784167653d313830)](https://github.com/avto-dev/bypass-finals/releases)[![Commits since latest release](https://camo.githubusercontent.com/d0582458d56162171f4b639fb336641e5fd0a51a576e70c497c992b93fc13f1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d6974732d73696e63652f6176746f2d6465762f6279706173732d66696e616c732f6c61746573742e7376673f7374796c653d666c61742d737175617265266d61784167653d313830)](https://github.com/avto-dev/bypass-finals/commits)

Changes log can be [found here](https://github.com/avto-dev/bypass-finals/blob/master/CHANGELOG.md).

Support
-------

[](#support)

[![Issues](https://camo.githubusercontent.com/f2ae2f6f4ab6b25779111d96ef8c7a9879c150aacdc2d44dcea5d1255525c6c8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6176746f2d6465762f6279706173732d66696e616c732e7376673f7374796c653d666c61742d737175617265266d61784167653d313830)](https://github.com/avto-dev/bypass-finals/issues)[![Issues](https://camo.githubusercontent.com/025541512351a6c9633b560a0ce8a573be81c4aa8b7e4f3492d6c8faa8de4a1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f6176746f2d6465762f6279706173732d66696e616c732e7376673f7374796c653d666c61742d737175617265266d61784167653d313830)](https://github.com/avto-dev/bypass-finals/pulls)

If you will find any package errors, please, [make an issue](https://github.com/avto-dev/bypass-finals/issues/new/choose) in current repository.

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 84.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~129 days

Recently: every ~95 days

Total

6

Last Release

2511d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6119929?v=4)[Eldario](/maintainers/eldario)[@eldario](https://github.com/eldario)

![](https://avatars.githubusercontent.com/u/52275?v=4)[Zaboday](/maintainers/zaboday)[@Zaboday](https://github.com/Zaboday)

---

Top Contributors

[![dg](https://avatars.githubusercontent.com/u/194960?v=4)](https://github.com/dg "dg (16 commits)")[![tarampampam](https://avatars.githubusercontent.com/u/7326800?v=4)](https://github.com/tarampampam "tarampampam (2 commits)")[![milo](https://avatars.githubusercontent.com/u/439140?v=4)](https://github.com/milo "milo (1 commits)")

---

Tags

file-mutatormockingphpunittestingtestingphpunitunitmockingfinals

### Embed Badge

![Health badge](/badges/avto-dev-bypass-finals/health.svg)

```
[![Health](https://phpackages.com/badges/avto-dev-bypass-finals/health.svg)](https://phpackages.com/packages/avto-dev-bypass-finals)
```

###  Alternatives

[dg/bypass-finals

Removes final keyword from source code on-the-fly and allows mocking of final methods and classes

56426.3M454](/packages/dg-bypass-finals)[nette/tester

Nette Tester: enjoyable unit testing in PHP with code coverage reporter. 🍏🍏🍎🍏

4917.3M1.5k](/packages/nette-tester)[elliotchance/concise

Concise is test framework for using plain English and minimal code, built on PHPUnit.

45223.8k4](/packages/elliotchance-concise)[janmarek/mockista

Mockista is library for mocking, which I've written, because I find mocking in PHPUnit awful.

29221.0k28](/packages/janmarek-mockista)[tcz/phpunit-mockfunction

PHPUnit extension that uses runkit to mock PHP functions (both user-defined and system)

4950.3k2](/packages/tcz-phpunit-mockfunction)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
