PHPackages                             mrferrys/command\_pattern - 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. mrferrys/command\_pattern

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

mrferrys/command\_pattern
=========================

Command pattern concept based on refactoring.guru and designpatterns solutions.

1.1.0(4y ago)49MiTPHPPHP &gt;=5.0.0

Since Oct 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/MrFerrys/Command_Pattern)[ Packagist](https://packagist.org/packages/mrferrys/command_pattern)[ RSS](/packages/mrferrys-command-pattern/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

Command Pattern Concept
=======================

[](#command-pattern-concept)

Command pattern concept based on refactoring.guru and designpatterns solutions.

Description
-----------

[](#description)

Command pattern concept.

Getting Started
---------------

[](#getting-started)

### Dependencies

[](#dependencies)

- PHP &gt;= 5
- ex. Command line

### Executing program

[](#executing-program)

- How to run a basic command.

```
    $invoker = new Invoker();
    $receiver = new SimpleCommand('Hello world');
    $invoker->setCommand($receiver);
    $invoker->run();

```

- How to run a complex command.

```
    $invoker = new Invoker();
    $receiver = new SimpleCommand('Hello world');
    $invoker->setCommand(new ComplexCommand($receiver,"Param_A","Param_B"));
    $invoker->run();

```

- How to run a nested complex command .

```
    $invoker        =   new Invoker();
    $receiver       =   new SimpleCommand('Hello worlddd');
	$complexCommand =   new ComplexCommand($receiver,'PARAM_AA','PARAM_BB');
    $invoker->setCommand(new ComplexCommand($complexCommand,'PARAM_A','PARAM_B'));
    $invoker->run();

```

- How to run a nested complex command aSync.

```
    $invoker        =   new Invoker();
    $receiver       =   new SimpleCommand('Hello worlddd');
    $complexCommand =   new ComplexCommand($receiver,'PARAM_AA','PARAM_BB');
    $invoker->setCommand(new ComplexCommand($complexCommand,'PARAM_A','PARAM_B',false));
    $invoker->run();

```

Authors
-------

[](#authors)

Ferrys

Version History
---------------

[](#version-history)

- 1.0.0
    - Initial Release (X.Y.Z MAJOR.MINOR.PATCH)
- 1.1.0
    - Verbosity level added
    - Folder name has changed from lib to src
    - lib name has changed from cmdlib to cmd

License
-------

[](#license)

This project is licensed under the MiT License - see the LICENSE.txt file for details

Acknowledgments
---------------

[](#acknowledgments)

Based on/Inspired By:

- [refactoring.guru](https://refactoring.guru/es/design-patterns/command/php/example)
- [designpatternsphp](https://designpatternsphp.readthedocs.io/en/latest/Behavioral/Command/README.html)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

6

Last Release

1659d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

1.1.0PHP &gt;=5.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/94b2b10811470824dce9ee4a92d901935f28524678047e4a2e9a58542830f6cf?d=identicon)[MrFerrys](/maintainers/MrFerrys)

---

Top Contributors

[![MrFerrys](https://avatars.githubusercontent.com/u/866868?v=4)](https://github.com/MrFerrys "MrFerrys (10 commits)")

### Embed Badge

![Health badge](/badges/mrferrys-command-pattern/health.svg)

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

###  Alternatives

[arrowjustdoit/crontab

Crontab extension for laravel-admin

334.0k](/packages/arrowjustdoit-crontab)

PHPackages © 2026

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