PHPackages                             sinsquare/composer-overload - 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. sinsquare/composer-overload

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

sinsquare/composer-overload
===========================

A simple tool to overload classes using composer

v0.1.1(7y ago)1379MITPHPPHP \*

Since Sep 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/SinSquare/composer-overload)[ Packagist](https://packagist.org/packages/sinsquare/composer-overload)[ RSS](/packages/sinsquare-composer-overload/feed)WikiDiscussions master Synced today

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

A simple tool that is used to "overload" classes.

A simple example:

Lets say you have the following code

```
use Random\Namespace\OriginalClass;

...

$class = new OriginalClass();
```

In this case composer will search the file, and load(include) it. But there might be a case when you want to load a dummy class instead of the original class, so your tests run for example.

To do it you have to use the ComposerOverload autoloader. Replace the original autoloader.

```
//original autoloader
$loader = require __DIR__.'/vendor/autoload.php';

//ComposerAutoloader autoloader
require __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/vendor/sinsquare/composer-overload/autoload_real.php';
$loader = ComposerOverLoaderInit::getLoader();
```

Then you can add the classes you want to overload

```
//original autoloader
$loader->addOverloadedClass('Random\Namespace\OriginalClass', __DIR__.'/overloaded/OverloadedClass.php');
```

To run the tests you have to run the two tests separately

- vendor/bin/phpunit tests/OriginalTest.php
- vendor/bin/phpunit tests/OverloadTest.php

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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 ~0 days

Total

2

Last Release

2832d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7294724?v=4)[Ábel Katona](/maintainers/SinSquare)[@SinSquare](https://github.com/SinSquare)

---

Top Contributors

[![SinSquare](https://avatars.githubusercontent.com/u/7294724?v=4)](https://github.com/SinSquare "SinSquare (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/sinsquare-composer-overload/health.svg)

```
[![Health](https://phpackages.com/badges/sinsquare-composer-overload/health.svg)](https://phpackages.com/packages/sinsquare-composer-overload)
```

###  Alternatives

[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5973.6M93](/packages/roave-backward-compatibility-check)[brianhenryie/strauss

Prefixes dependencies namespaces so they are unique to your plugin

186406.5k30](/packages/brianhenryie-strauss)[dominikb/composer-license-checker

Utility to check for licenses of dependencies and block/allow them.

574.3M12](/packages/dominikb-composer-license-checker)[magento/composer

Magento composer library helps to instantiate Composer application and run composer commands.

317.8M12](/packages/magento-composer)[noerd/noerd

101.3k6](/packages/noerd-noerd)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

39250.0k28](/packages/ec-europa-toolkit)

PHPackages © 2026

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