PHPackages                             jpc/design-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. jpc/design-pattern

ActiveLibrary

jpc/design-pattern
==================

Simple Design Patter integration

1.1.0(5y ago)044.4k↓37.7%GPL-3.0PHPPHP &gt;=5.4

Since Sep 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/JoffreyPoreeCoding/DesignPattern)[ Packagist](https://packagist.org/packages/jpc/design-pattern)[ Docs](https://github.com/JoffreyPoreeCoding/DesignPattern)[ RSS](/packages/jpc-design-pattern/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (0)

DesignPattern
=============

[](#designpattern)

**DesignPattern** library allow you to simply include design pattern like **Singleton** or **Multiton** into your classes.

Installation
------------

[](#installation)

Use `composer require jpc/design-pattern` to install with composer.

How to use
----------

[](#how-to-use)

### Create the singleton class

[](#create-the-singleton-class)

Create your class which you want to be a Singleton class.

```

```

Then, add the Singleton trait.

```

```

### Get the Singleton class

[](#get-the-singleton-class)

You can simply use the static function `getInstance` to get singleton instance.

```
//Some Code
$mySingleton = MySingletonClass::getInstance($param1, $param2);
//Some Code
```

#### For **Multiton**

[](#for-multiton)

The unique difference between Singleton and Multiton is when you get the instance, you have to pass an identifier like that :

```
//Some Code
$myMultiton = MyMultitonClass::getInstance("IDENTIFIER", $param1, $param2);
//Some Code
```

It's allow you to make different instance with different parameters.

Thanks You!
-----------

[](#thanks-you)

Thanks you for reading and maybe for downloading and use this library! If you have some request, make them and i will code it for you!

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~367 days

Total

8

Last Release

2014d ago

Major Versions

0.2.0 → 1.0.02016-11-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/98f6dc165225e41186faf7b510ef920bf4085e3ffe4f33745d2e3600994cec8a?d=identicon)[JoffreyPoreeCoding](/maintainers/JoffreyPoreeCoding)

---

Tags

traitsingletonmultitonDesignPattern

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jpc-design-pattern/health.svg)

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

###  Alternatives

[nette/robot-loader

🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.

89352.7M321](/packages/nette-robot-loader)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[kkszymanowski/traitor

Add a trait use statement to existing PHP class

1305.2M16](/packages/kkszymanowski-traitor)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[degraciamathieu/manager

Implementation of the Manager pattern existing in Laravel framework.

9175.9k1](/packages/degraciamathieu-manager)

PHPackages © 2026

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