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

1.0.1(1mo ago)53.2k24proprietaryPHPPHP ^8.3CI passing

Since Jan 25Pushed 1w ago1 watchersCompare

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

READMEChangelogDependencies (30)Versions (9)Used By (4)

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

51

—

FairBetter than 95% of packages

Maintenance95

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity55

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

Total

5

Last Release

37d ago

Major Versions

0.2.0 → 1.0.12026-05-26

### 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.5k5.9M734](/packages/sylius-sylius)[driftingly/rector-laravel

Rector upgrades rules for Laravel Framework

1.2k15.4M721](/packages/driftingly-rector-laravel)[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.2k28.9M2.3k](/packages/infection-infection)[mailgun/mailgun-php

The Mailgun SDK provides methods for all API functions.

1.1k30.8M181](/packages/mailgun-mailgun-php)[humbug/box

Fast, zero config application bundler with PHARs.

1.3k894.7k87](/packages/humbug-box)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9224.3M28](/packages/phparkitect-phparkitect)

PHPackages © 2026

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