PHPackages                             evo/patterns - 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. evo/patterns

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

evo/patterns
============

Common programing patterns

2.1.0(1y ago)0963GPL-3.0PHPPHP &gt;=8.3

Since Dec 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ArtisticPhoenix/Pattern)[ Packagist](https://packagist.org/packages/evo/patterns)[ RSS](/packages/evo-patterns/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (4)DependenciesVersions (5)Used By (3)

Patterns
========

[](#patterns)

Common programing patterns for evo

- Singleton (trait and interface)
- Multiton (trait and interface)

If you don't know what a Singlton is I suggest reading about it

[https://en.wikipedia.org/wiki/Singleton\_pattern](https://en.wikipedia.org/wiki/Singleton_pattern)

Singleton useage

```
use evo\pattern\singleton\SingletonTrait;
use evo\pattern\singleton\SingletonInterface;

Class Foo implements SingletonInterface{
    use Singleton;
    protected function init(){
       //stuff to do on __construct
    }
}

```

Then you can call your class like this (each additional call will return the same instance of the class)

```
$Foo = Foo:getInstance();

```

Multiton usage

```
use evo\pattern\singleton\MultitonTrait;
use evo\pattern\singleton\MultitonInterface;

 Class Foo implements MultitonInterface{
     use Multiton;
     protected function init(){
        //stuff to do on __construct
     }
 }

```

Then you can call your class like this

```
$Foo = Foo:getInstance();

```

The diffrence between them is the Multiton acts more like a container for Singlton instances. So you can call the `getInstance` method multiple times with diffrent aliases and get multiple copies of the class, each a singleton in it's own right. Becareful using Static proprites on multitons as they can be a bit tricky.

```
//this will produce two singleton instances of the class
$Foo1 = Foo:getInstance('instance1');
$Foo2 = Foo:getInstance('instance2');

```

Install via composer

```
{
    "require" : {
        "evo/patterns" : "~1.0"
    }
}

```

I plan to add a few more to this, as needed.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~225 days

Total

4

Last Release

564d ago

Major Versions

1.1.0 → 2.0.02024-09-09

PHP version history (2 changes)1.0.2PHP &gt;=5.6

2.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/73ff70bb5a9ec9b1a9372e4246373418e694cac33b4353befd95487047d856bc?d=identicon)[ArtisticPhoenix](/maintainers/ArtisticPhoenix)

---

Top Contributors

[![ArtisticPhoenix](https://avatars.githubusercontent.com/u/8208075?v=4)](https://github.com/ArtisticPhoenix "ArtisticPhoenix (12 commits)")[![hdurham](https://avatars.githubusercontent.com/u/53230651?v=4)](https://github.com/hdurham "hdurham (4 commits)")

---

Tags

patterns

### Embed Badge

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

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

PHPackages © 2026

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