PHPackages                             codedruids/black-hole - 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. codedruids/black-hole

ActiveLibrary[Testing &amp; Quality](/categories/testing)

codedruids/black-hole
=====================

Testing class that ignores everything while still being valid

v1.1(5y ago)2175MITPHPPHP &gt;=5.6.0

Since Aug 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/CodeDruids/black-hole)[ Packagist](https://packagist.org/packages/codedruids/black-hole)[ RSS](/packages/codedruids-black-hole/feed)WikiDiscussions stable Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

BlackHole
=========

[](#blackhole)

[![Latest release](https://camo.githubusercontent.com/29c727e76985711298ff86e514df31c68988a2c79479ff665ce99f9bc66b9cd6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f436f64654472756964732f626c61636b2d686f6c653f736f72743d73656d766572266c6162656c3d72656c65617365)](https://github.com/CodeDruids/black-hole/releases)[![Build Status](https://camo.githubusercontent.com/cf0c5189bf9992de80eaed7d10c65fc55b4fb5d174b64fc163f29df78643a397/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f436f64654472756964732f626c61636b2d686f6c652f737461626c65)](https://travis-ci.org/CodeDruids/black-hole)[![Code Coverage](https://camo.githubusercontent.com/d5d64022fafea01291767604239f4f637bf3c7d18a41468cefe8a60aa7632517/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f436f64654472756964732f626c61636b2d686f6c65)](https://scrutinizer-ci.com/g/CodeDruids/black-hole/)[![Code Quality](https://camo.githubusercontent.com/9c8222cc0edadfabbb2b76421d5e2f4fa3de50e027e96e097416d5779f444c5d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f436f64654472756964732f626c61636b2d686f6c65)](https://scrutinizer-ci.com/g/CodeDruids/black-hole/)[![Software License](https://camo.githubusercontent.com/7fa04a85519b1ace11b5b8a54c18f5bb7fe3b592042a770249f0f58054158dde/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f436f64654472756964732f626c61636b2d686f6c653f636f6c6f723d626c7565)](LICENSE)

BlackHole is a PHP testing class that ignores anything done to it.

Requirements
------------

[](#requirements)

- PHP 5.6 or higher

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

[](#installation)

Add the following to your `composer.json`:

```
{
    "require": {
        "CodeDruids/black-hole": "1.*"
    }
}
```

Basic Usage
-----------

[](#basic-usage)

```
$test = new \CodeDruids\BlackHole("test");

$test->a = "b";
unset($test->c);
isset($test->d)
$test->e("f");
\CodeDruids\BlackHole::g("h")
var_dump($test);
echo $test;
$test();
```

This can be useful when you need a placeholder object, or want the ability to switch a class alias to remove any impact on a production environment. e.g.

```
if (env('APP_ENV') == 'production') {
	class_alias('CodeDruids\BlackHole', 'Debug');
}
else {
	class_alias('My\Clever\Debugger', 'Debug');
}
Debug::log('Profound silence');
```

Support
-------

[](#support)

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/CodeDruids/black-hole/issues), or better yet, fork the library and submit a pull request.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

2

Last Release

2110d ago

### Community

Maintainers

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

---

Top Contributors

[![leith](https://avatars.githubusercontent.com/u/647389?v=4)](https://github.com/leith "leith (7 commits)")

---

Tags

testingmockDummyplaceholderignoreblackholeblack hole

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/codedruids-black-hole/health.svg)

```
[![Health](https://phpackages.com/badges/codedruids-black-hole/health.svg)](https://phpackages.com/packages/codedruids-black-hole)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

36918.1M98](/packages/php-mock-php-mock)[phake/phake

The Phake mock testing library

4758.0M324](/packages/phake-phake)[kahlan/kahlan

The PHP Test Framework for Freedom, Truth and Justice.

1.2k1.2M247](/packages/kahlan-kahlan)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33412.5M350](/packages/brain-monkey)

PHPackages © 2026

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