PHPackages                             jasir/unfinalizer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jasir/unfinalizer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jasir/unfinalizer
=================

Plugs in composer autolader and removes final keyword from autoloaded classes on fly.

311[1 issues](https://github.com/jasir/unfinalizer/issues)

Since Apr 11Pushed 13y ago1 watchersCompare

[ Source](https://github.com/jasir/unfinalizer)[ Packagist](https://packagist.org/packages/jasir/unfinalizer)[ RSS](/packages/jasir-unfinalizer/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Unfinalizer
===========

[](#unfinalizer)

Plugs in the composer autolader and removes the final keywords from autoloaded classes on the fly.

This allows you to mock the final classes and methods in your unit tests.

Usage
-----

[](#usage)

Add the Unfinalizer to your project:

```
composer require --dev jasir/unfinalizer:dev-master

```

In your tests bootstrap file, load Unfinalizer before your composer loading:

```
include __DIR__ . '/vendor/jasir/unfinalizer/init.php' //add this line
include __DIR__ . '/vendor/autoload.php';

```

That's all. Now all the files loaded by the composer autoloading process are without the final methods and classes.

Adding own files or files with their own loader
-----------------------------------------------

[](#adding-own-files-or-files-with-their-own-loader)

Some frameworks, like Nette, uses their own loader. You can solve this by adding own files to loader:

```
include __DIR__ . '/vendor/jasir/unfinalizer/init.php' //add this line
$loader = include __DIR__ . '/vendor/autoload.php';

$loader->add('Nette', __DIR__ . '/vendor/nette/nette');

```

Now you can mock those finals! Happy testing.

TODO
----

[](#todo)

Please note this project is in a very alpha stage, so the code is very minimalistic.

I would like to add (maybe):

- not evaluate changed files, but saving them in cache for easier debugging
- ... ?

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e5db7a153f3bab43e30e9748214e2abe4ec95006e165e578ea2921586e6bdcb?d=identicon)[jasir](/maintainers/jasir)

---

Top Contributors

[![jasir](https://avatars.githubusercontent.com/u/115066?v=4)](https://github.com/jasir "jasir (3 commits)")[![stepansvoboda](https://avatars.githubusercontent.com/u/168612?v=4)](https://github.com/stepansvoboda "stepansvoboda (1 commits)")

### Embed Badge

![Health badge](/badges/jasir-unfinalizer/health.svg)

```
[![Health](https://phpackages.com/badges/jasir-unfinalizer/health.svg)](https://phpackages.com/packages/jasir-unfinalizer)
```

###  Alternatives

[yucca/prerender-bundle

Allows you to easily use prerender for your Symfony apps running Client-Side MVC

5617.1k](/packages/yucca-prerender-bundle)

PHPackages © 2026

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