PHPackages                             ocramius/finalizer - 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. ocramius/finalizer

Abandoned → [rector/rector](/?search=rector%2Frector)ArchivedLibrary[Testing &amp; Quality](/categories/testing)

ocramius/finalizer
==================

A simple utility library that checks for PHP classes that should or shouldn't be marked as final

1.0.0(11y ago)783.3k6[7 issues](https://github.com/Ocramius/Finalizer/issues)3MITPHPPHP ~5.6|~7.0

Since Feb 27Pushed 7y ago5 watchersCompare

[ Source](https://github.com/Ocramius/Finalizer)[ Packagist](https://packagist.org/packages/ocramius/finalizer)[ Docs](https://github.com/Ocramius/Finalizer)[ RSS](/packages/ocramius-finalizer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (3)

Finalizer
=========

[](#finalizer)

This library aims at providing simple tools that help deciding whether a class should or shouldn't be declared as `final`.

[![Build Status](https://camo.githubusercontent.com/7e685101419939b38decacd99316f918dafe0f9fb51f5512b9bed04de96fcd16/68747470733a2f2f7472617669732d63692e6f72672f4f6372616d6975732f46696e616c697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Ocramius/Finalizer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ad2b72a65ecee625612b93a1415977c247dfb2e3f4e74ef1485e49d5fad7e7f7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f6372616d6975732f46696e616c697a65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Ocramius/Finalizer/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/a1fd8985087c89525777c23b1c995aa1b81528f6169f4c9a0b980be20ba37d3d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f6372616d6975732f46696e616c697a65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Ocramius/Finalizer/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/66b3cf6fcffd3e58ae5229ff8e302a042c8a0728c19467831913f94a143fc808/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f66696e616c697a65722f762f737461626c652e706e67)](https://packagist.org/packages/ocramius/finalizer)[![Latest Unstable Version](https://camo.githubusercontent.com/aaa398eee8dea27dea6abebc3d27937929d8e93b3279be984b482ee6abae62da/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f66696e616c697a65722f762f756e737461626c652e706e67)](https://packagist.org/packages/ocramius/finalizer)

Help/Support
------------

[](#helpsupport)

[![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/Ocramius/Finalizer)

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

[](#installation)

Install via [composer](https://getcomposer.org/):

```
php composer.phar require ocramius/finalizer:~1.0
```

Usage
-----

[](#usage)

In your console, simply type:

```
./vendor/bin/finalizer finalizer:check-final-classes path/to/directory
./vendor/bin/finalizer finalizer:check-final-classes also/supports multiple/directories as/parameters
```

Note that finalizer will take decisions on whether classes should or shouldn't be `final` depending on the classes defined in the directories that you passed to it.

Additionally, be aware that `finalizer` will (in its current state) require any of the PHP or Hack files in the given directories and include them via `require_once`.

Reference
---------

[](#reference)

If you need to know more about why I wrote this library, and what kind of decisions it is doing, then please read [this blogpost about the usage of the `final` keyword](http://goo.gl/4eCCIK).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

4099d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd0445bc21fa116c259b5889377b90cbd8a34d49357321f76a74f6d2c2ae6b0c?d=identicon)[Ocramius](/maintainers/Ocramius)

---

Top Contributors

[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (82 commits)")[![catalinux](https://avatars.githubusercontent.com/u/2072712?v=4)](https://github.com/catalinux "catalinux (3 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (2 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (1 commits)")[![marcosdsanchez](https://avatars.githubusercontent.com/u/45263?v=4)](https://github.com/marcosdsanchez "marcosdsanchez (1 commits)")[![Rarst](https://avatars.githubusercontent.com/u/737584?v=4)](https://github.com/Rarst "Rarst (1 commits)")

---

Tags

code qualitysyntaxfinal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ocramius-finalizer/health.svg)

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

###  Alternatives

[phan/phan

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[overtrue/phplint

`phplint` is a tool that can speed up linting of php files by running several lint processes at once.

1.0k13.2M726](/packages/overtrue-phplint)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

598161.9M1.9k](/packages/dealerdirect-phpcodesniffer-composer-installer)[micheh/phpcs-gitlab

GitLab Report for PHP\_CodeSniffer (display the violations in the GitLab CI/CD Code Quality Report)

4411.1M17](/packages/micheh-phpcs-gitlab)[laraveldaily/filacheck

Static analysis for Filament projects - detect deprecated patterns and code issues

9016.5k](/packages/laraveldaily-filacheck)[php-censor/phpdoc-checker

A simple tool for checking that your PHP classes and methods use PHPDocs (PHP DocBlocks Checker fork).

1374.1k2](/packages/php-censor-phpdoc-checker)

PHPackages © 2026

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