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

ActiveLibrary

axelitus/design-patterns
========================

Design Patterns for PHP

v0.3.1(12y ago)42631MITPHPPHP &gt;=5.4.9

Since Aug 5Pushed 12y ago1 watchersCompare

[ Source](https://github.com/axelitus/php-design-patterns)[ Packagist](https://packagist.org/packages/axelitus/design-patterns)[ Docs](http://axelitus.mx/projects/axelitus/design-patterns)[ RSS](/packages/axelitus-design-patterns/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

Design Patterns for PHP
=======================

[](#design-patterns-for-php)

A framework agnostic PHP package that contains base classes to easily extend and implement some design patterns.

Package Information
-------------------

[](#package-information)

- **Package:** Patterns
- **Version:** 0.3.1
- **Namespace:** axelitus\\DesignPatterns
- **Author:** Axel Pardemann ()
- **Roadmap:** [axelitus/design-patterns at Interstate](http://roadma.ps/2TA "axelitus/design-patterns at Interstate")
- **Repository**: [axelitus/php-design-patterns at GitHub](https://github.com/axelitus/php-design-patterns "axelitus/php-design-patterns at GitHub")
- **Build Status (master):** [![Build Status](https://camo.githubusercontent.com/c675bfa07c7a222c0e85c43c25b03e90022244c2dac6dd2b5ef3d38ad9b1a862/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6178656c697475732f7068702d64657369676e2d7061747465726e732e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/axelitus/php-design-patterns)
- **Build Status (develop):** [![Build Status](https://camo.githubusercontent.com/9b7fbf6260c131e2174d8c49bfb58318603d9dfe9a68278b5f7959dd0d950e52/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6178656c697475732f7068702d64657369676e2d7061747465726e732e706e673f6272616e63683d646576656c6f70)](http://travis-ci.org/axelitus/php-design-patterns)
- **Composer Package:** [axelitus/design-patterns at Packagist](http://packagist.org/packages/axelitus/design-patterns "axelitus/design-patterns at Packagist")
- **Issue Tracker:** [GitHub's issue tracker](https://github.com/axelitus/php-design-patterns/issues "GitHub's issue tracker")

Requirements
------------

[](#requirements)

The requirements for this package to work are the following:

- PHP &gt;= 5.4.\*

Standards
---------

[](#standards)

This package is intended to follow some standards for easy contributions and usage. Recently there has been an initiative to standardize the interoperation of frameworks, though I think this easily extends to most pieces of code everyone is building. The group behind all this is the [PHP-FIG (Framework Interoperability Group)](http://www.php-fig.org), you should pay them a visit at their site.

There are already some standards marked as accepted (*final*): [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md), [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md).

**This package is intentend to be PSR-2 compliant.**

Being PSR-2 compliant means this package can be easily installed by using [Composer](getcomposer.org) from the [Packagist](http://packagist.org) package archive. Just follow the instructions in section [How to install](#how-to-install). It also means that there's a [guide for coding styles](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and the developers and contributors should enforce this for everyone's benefit.

Contents
--------

[](#contents)

All classes are referenced to the package namespace if not otherwise stated.

- **Utils** - Has some useful utilities encapsulated.
- **Creational\\Factory** - Defines a Factory object.
- **Creational\\Multiton** - Defines a Multiton object.
- **Creational\\MultitonShelf** - Defines a MultitonShelf object.
- **Creational\\Singleton** - Defines a Singleton object.
- **Creational\\SingletonShelf** - Defines a SingletonShelf object.
- **Creational\\TMultiton** - Defines a generic Multiton object.
- **Creational\\TSingleton** - Defines a generic Singleton object.
- **Interfaces\\Forgeable** - Defines the interface for an object that is forgeable.
- **Interfaces\\Initializable** - Defines the interface for an object that is initializable.

How to install
--------------

[](#how-to-install)

To install this package and use it in your app just follow these instructions (if you haven't read the documentation from [Composer](http://getcomposer.org) please do so before you continue):

1. Download composer if you haven't already done so (use your preferred method). Example:

```
$ curl -s https://getcomposer.org/installer | php

```

2. Place a `require` statement inside your `composer.json` file replacing `` with the desired version. Example:

```
"require": {
    "axelitus/design-patterns": ""
}

```

3. Run the composer installer to resolve dependencies and download the packages. Example:

```
$ php composer.phar install

```

4. In order to use the packages you have to *load* the autoloader that was generated by composer. Example:

```
require 'vendor/autoload.php';

```

5. Finally just use the package classes as needed:

```
axelitus\DesignPatterns\[\...]::();

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

Total

4

Last Release

4659d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61386558d4fa03cc9de21d20e76f396d5568e0e647e1cdf18f12c87f1a5f87b5?d=identicon)[axelitus](/maintainers/axelitus)

---

Top Contributors

[![axelitus](https://avatars.githubusercontent.com/u/732441?v=4)](https://github.com/axelitus "axelitus (73 commits)")

---

Tags

factoryarchitecturedesignsingletonmultitonpatterns

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[http-interop/http-factory-guzzle

An HTTP Factory using Guzzle PSR7

581167.2M519](/packages/http-interop-http-factory-guzzle)[nette/di

💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP features.

92140.6M1.4k](/packages/nette-di)[php-http/multipart-stream-builder

A builder class that help you create a multipart stream

29390.9M224](/packages/php-http-multipart-stream-builder)[zenstruck/foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

78311.9M97](/packages/zenstruck-foundry)

PHPackages © 2026

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