PHPackages                             rpodwika/designpatterns - 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. rpodwika/designpatterns

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

rpodwika/designpatterns
=======================

PHP Design Patterns

1.10.0(9y ago)957GPLPHP

Since Jul 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/rpodwika/designpatterns)[ Packagist](https://packagist.org/packages/rpodwika/designpatterns)[ RSS](/packages/rpodwika-designpatterns/feed)WikiDiscussions master Synced 1mo ago

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

\#Design Patterns for PHP

[![Build Status](https://camo.githubusercontent.com/0cbaccb8d52813c507c653f013e13a04c880be0d5472af7e6125b558520aaf3f/68747470733a2f2f7472617669732d63692e6f72672f72706f6477696b612f64657369676e7061747465726e732e737667)](https://travis-ci.org/rpodwika/designpatterns)[![Coverage Status](https://camo.githubusercontent.com/59cdc7f27447d95c8cc62bbcb235ddd52a6df54549c9a22153705c9341c683fe/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f72706f6477696b612f64657369676e7061747465726e732f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/rpodwika/designpatterns?branch=master)[![Dependency Status](https://camo.githubusercontent.com/39426588723eed1b49241c78916f36f91ad7f8ea90a491631d9fdc484d39f270/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535396566643533363633363335303031633030303031352f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/559efd53663635001c000015)[![Latest Stable Version](https://camo.githubusercontent.com/0efd21cb12139b7fe9439750a72397f8b02f3a346fd5cff3a8c1274b7e565067/68747470733a2f2f706f7365722e707567782e6f72672f72706f6477696b612f64657369676e7061747465726e732f762f737461626c65)](https://packagist.org/packages/rpodwika/designpatterns) [![Total Downloads](https://camo.githubusercontent.com/7afb5594606ad1c881295fcda0c109f0302c415b5b2d02fa0b1aa678c7529eb1/68747470733a2f2f706f7365722e707567782e6f72672f72706f6477696b612f64657369676e7061747465726e732f646f776e6c6f616473)](https://packagist.org/packages/rpodwika/designpatterns) [![Latest Unstable Version](https://camo.githubusercontent.com/a478cf4190983b5c2778ad7b0f0d8da2ea4c66b58b6eb071fd90d68c8e58becf/68747470733a2f2f706f7365722e707567782e6f72672f72706f6477696b612f64657369676e7061747465726e732f762f756e737461626c65)](https://packagist.org/packages/rpodwika/designpatterns) [![License](https://camo.githubusercontent.com/da234726b6d9af0148d828c7dbb1b8b47ff2b5c96290e92c10089d01c588390d/68747470733a2f2f706f7365722e707567782e6f72672f72706f6477696b612f64657369676e7061747465726e732f6c6963656e7365)](https://packagist.org/packages/rpodwika/designpatterns)

\##Why

For my own pratice and to help other programmers I decided to implement several Design Patterns in PHP. I hope you like it and you will find it helpful. If you have any suggestions how can I write something better please create pull request or message me

\##What are design patterns

Design problems are proven to work solutions for problems that often occur while writing applications.

\##Why to use them

Because they solve problems. You do not need to invent solution that is already working. How many times during your programmer career you had this feeling that you already solved problem that you are facing now? Same goes with patterns you have problem that could be solved using specific pattern. Keep in mind that you should not force your code to fit in patterns. It should come out naturally. Firstly K.I.S.S.

\##Implemented patterns

1. Antipatterns
    - [Singleton](src/Antipatterns/) - One global instance of a class
2. Behavioral
    - [Adapter](src/Behavioral/Adapter) - adapt class behavior to new conditions without modifying source of original class
    - [Chain of responsibility](src/Behavioral/ChainOfResponsibility) - Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request
    - [Memento](src/Behavioral/Memento) - Without violating encapsulation, capture and externalize an object's internal state
    - [Observer](src/Behavioral/Observer) - Define one to many dependency between objects so that when one changes state, all its dependents are notified and updated automatically
    - [Proxy](src/Behavioral/Proxy) - Do some operations before giving access to origin object
    - [State](src/Behavioral/State) - allow object to alter its behavior depending on current internal state change.
    - [Strategy](src/Behavioral/Strategy) - Define a family of algorithms and make them interchangeable.
3. Creational
    - [Abstract Factory](src/Creational/AbstractFactory) - Provides interface for creating families of objects working together without specification of concrete classes
    - [Factory](src/Creational/Factory) - Define an interface for creating an object but let the subclasses decide which class to instantiate
4. Structural
    - [Decorator](src/Structural/Decorator) - Attach additional object features dynamically without subclassing or modifying source class.

\##To be implemented

- Builder
- Prototype
- Bridge
- Composite
- Facade
- Flyweight
- Command
- Interpreter
- Iterator
- Mediator
- Visitor

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity73

Established project with proven stability

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

Recently: every ~84 days

Total

21

Last Release

3624d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba61a85f15cc83696965d2d2bcc7e5432d767243b6034c5d8ce91dfbea9d2ce6?d=identicon)[rpodwika](/maintainers/rpodwika)

---

Top Contributors

[![rpodwika](https://avatars.githubusercontent.com/u/7974890?v=4)](https://github.com/rpodwika "rpodwika (57 commits)")

### Embed Badge

![Health badge](/badges/rpodwika-designpatterns/health.svg)

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

###  Alternatives

[andrejsstepanovs/business-days-calculator

Business day calculation

2361.9k](/packages/andrejsstepanovs-business-days-calculator)[jimbojsb/workman

PHP process forking &amp; daemonizing library

608.8k](/packages/jimbojsb-workman)

PHPackages © 2026

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