PHPackages                             entropy/entropy - 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. [CLI &amp; Console](/categories/cli)
4. /
5. entropy/entropy

ActiveLibrary[CLI &amp; Console](/categories/cli)

entropy/entropy
===============

Entropy framework

0.4.6(1mo ago)5107.6k27proprietaryPHPPHP ^8.4CI passing

Since Jan 25Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/TomasVotruba/entropy)[ Packagist](https://packagist.org/packages/entropy/entropy)[ RSS](/packages/entropy-entropy/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (43)Versions (18)Used By (7)

Entropy
=======

[](#entropy)

A tiny framework with a dependency injection container and a console runner. No configuration, no YAML, no magic strings - just classes.

Requires PHP 8.3+.

Install
-------

[](#install)

```
composer require entropy/entropy
```

1. Dependency Injection
-----------------------

[](#1-dependency-injection)

The container autowires services through reflection. Point it at a directory and every class in it becomes an available service.

```
use Entropy\Container\Container;

$container = new Container();
$container->autodiscover(__DIR__ . '/src');

$someService = $container->make(SomeService::class);
```

Need a custom factory? Register it manually:

```
$container->service(PDO::class, function (Container $container): PDO {
    return new PDO('sqlite::memory:');
});
```

Need every implementation of an interface? Ask for the contract:

```
$listeners = $container->findByContract(EventListenerInterface::class);
```

The container detects circular dependencies and tells you exactly where the cycle is, e.g. `A -> B -> C -> A`.

2. Console
----------

[](#2-console)

Implement `CommandInterface` and the command is wired up automatically:

```
use Entropy\Console\Contract\CommandInterface;
use Entropy\Console\Enum\ExitCode;
use Entropy\Console\Output\OutputPrinter;

final readonly class HelloCommand implements CommandInterface
{
    public function __construct(
        private OutputPrinter $outputPrinter
    ) {
    }

    public function getName(): string
    {
        return 'hello';
    }

    public function getDescription(): string
    {
        return 'Say hello';
    }

    /**
     * @param string[] $names Names to greet.
     * @param bool $loud Shout instead of speak.
     */
    public function run(array $names, bool $loud = false): int
    {
        foreach ($names as $name) {
            $greeting = $loud ? "HELLO {$name}!" : "Hello {$name}";
            $this->outputPrinter->green($greeting);
        }

        return ExitCode::SUCCESS;
    }
}
```

The `run()` method signature *is* the command definition. Parameter types, default values, and docblocks become CLI arguments, options, and help text. No attributes to add, no input objects to wire.

Boot the application from your binary:

```
use Entropy\Console\ConsoleApplication;
use Entropy\Container\Container;

$container = new Container();
$container->autodiscover(__DIR__ . '/src');

$consoleApplication = $container->make(ConsoleApplication::class);
exit($consoleApplication->run($argv));
```

That's it. Run it:

```
bin/console hello Alice Bob --loud
```

By convention, the first `string` or `array` parameter becomes a positional argument; everything else becomes a `--option`. To force the first parameter to be an option instead, mark it with `@option` in the docblock:

```
/**
 * @option $source
 * @param string $source The source path
 */
public function run(string $source, bool $verbose = false): int
{
    // ...
}
```

```
bin/console hello --source=src/
```

Typo a command name and the fuzzy matcher will pick the closest one. Pass `--help` for global help, or ` --help` for per-command help built from your docblocks.

Happy coding!

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance89

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.4% 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 ~4 days

Total

13

Last Release

58d ago

Major Versions

0.2.0 → 1.0.12026-05-26

PHP version history (2 changes)0.1.0PHP ^8.3

0.4.2PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/924196?v=4)[Tomas Votruba](/maintainers/TomasVotruba)[@TomasVotruba](https://github.com/TomasVotruba)

---

Top Contributors

[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (331 commits)")[![M-arcus](https://avatars.githubusercontent.com/u/25648755?v=4)](https://github.com/M-arcus "M-arcus (2 commits)")

---

Tags

clicommanddependency-injectionframeworkminimalismphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M777](/packages/sylius-sylius)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k30.0M2.8k](/packages/infection-infection)[driftingly/rector-laravel

Rector upgrades rules for Laravel Framework

1.3k16.7M913](/packages/driftingly-rector-laravel)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9244.5M32](/packages/phparkitect-phparkitect)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M235](/packages/sulu-sulu)[veewee/xml

XML without worries

1837.3M39](/packages/veewee-xml)

PHPackages © 2026

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