PHPackages                             ngmy/observer - 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. ngmy/observer

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

ngmy/observer
=============

A PHP library to implement the observer pattern

0.2.0(5y ago)0268[1 PRs](https://github.com/ngmy/php-observer/pulls)1MITPHPPHP ^7.3|^8.0

Since Mar 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ngmy/php-observer)[ Packagist](https://packagist.org/packages/ngmy/observer)[ Fund](https://flattr.com/@ngmy)[ GitHub Sponsors](https://github.com/ngmy)[ RSS](/packages/ngmy-observer/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (4)Used By (1)

PHP Observer
============

[](#php-observer)

[![Latest Stable Version](https://camo.githubusercontent.com/567a4a3e34c45444ec322461502fc359396c6c09e0464f38f4b3764deb7d72ce/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f627365727665722f76)](//packagist.org/packages/ngmy/observer)[![Total Downloads](https://camo.githubusercontent.com/3ede31cd0305fe6e3337411561fb200d56cd7343f5dc48bbda139840ecb5f925/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f627365727665722f646f776e6c6f616473)](//packagist.org/packages/ngmy/observer)[![Latest Unstable Version](https://camo.githubusercontent.com/68588d9ef727bb9a0a50d462528dba135b77fd770425e3b399a98d2c4b99be9b/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f627365727665722f762f756e737461626c65)](//packagist.org/packages/ngmy/observer)[![License](https://camo.githubusercontent.com/fdbda06b045d9c0b1cd6d7f7057767aa2904f71754b6470dcc58fcf5c2ffdd44/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f627365727665722f6c6963656e7365)](//packagist.org/packages/ngmy/observer)[![composer.lock](https://camo.githubusercontent.com/6b7ddc280e72d1efffe93edd8d3814c1303fb925175790d9b8886cf2a9d68587/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f627365727665722f636f6d706f7365726c6f636b)](//packagist.org/packages/ngmy/observer)[![PHP CI](https://github.com/ngmy/php-observer/actions/workflows/php.yml/badge.svg)](https://github.com/ngmy/php-observer/actions/workflows/php.yml)[![Coverage Status](https://camo.githubusercontent.com/b4edc07f80ea4c11e7ff669e70cad6e690385c83cb9710cfb352e5cfecb8962c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e676d792f7068702d6f627365727665722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ngmy/php-observer?branch=master)[![PHPStan](https://camo.githubusercontent.com/441b5874ce4df0a2defc892979c96c46889b69cb32119d04f0b48626349f8bc9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/phpstan/phpstan)[![Psalm Coverage](https://camo.githubusercontent.com/fa224155a171ac0571874f0e6cd80f5bedf02feb38b571406c04438912769a7a/68747470733a2f2f73686570686572642e6465762f6769746875622f6e676d792f7068702d6f627365727665722f636f7665726167652e7376673f)](https://shepherd.dev/github/ngmy/php-observer)[![Psalm Level](https://camo.githubusercontent.com/095b0287634ead7a0946e710e4cb675dc73d39ea334c1f68b51840d0087fd818/68747470733a2f2f73686570686572642e6465762f6769746875622f6e676d792f7068702d6f627365727665722f6c6576656c2e7376673f)](https://shepherd.dev/github/ngmy/php-observer)

PHP Observer is a PHP library to implement the [observer pattern](https://en.wikipedia.org/wiki/Observer_pattern).

- Provides the subject and observer interfaces. This allows you to implement the concrete subject and observer classes

[![class-diagram](https://camo.githubusercontent.com/189dd38b582a97de90a4fb3c0cf661ed65ff03d93fd31635edb60887c9b8e464/687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f684c37316866696d3442707841725138305f493947772d7148503777304a7461326d6d696d504d6e4b2d79496651686f78784c62333862786f414d53734474506350746e594c57774e58536a733577314256494d7349756d4165533341736b346133736e616d46335555725f2d595279344732444c694856565f49347865516b577a396b6c2d4937377639503364454c6e695571526b35637248576d3878783736436a672d62736270614338747137474533374f4148744b6a58346430325268714244324c56416967456473677133496171416d3442775a724e4a685450494353523773757554304371424734713850485a5639304d345f44703179523369666337414f665264576b444c46486c334e415a4c4c5978685a77344c76335a507a72624f374b75454d48463354636934584f734233455f694277334e736162576f31696542796663335558716749624b347237624d454e6c526664713175466b684378316248673778764e335f58655473645853322d30506250336536774a6146796a707837677a516858654e44346f47556261304a50764e495637645f7072435445784b504f784d696f46524469687977706f4c4b5178664b6a516c726a44726e55533252314461463149414a794c6b4d5549493672525a354132586f35384739792d5f426c656c)](http://www.plantuml.com/plantuml/uml/hL71hfim4BpxArQ80_I9Gw-qHP7w0Jta2mmimPMnK-yIfQhoxxLb38bxoAMSsDtPcPtnYLWwNXSjs5w1BVIMsIumAeS3Ask4a3snamF3UUr_-YRy4G2DLiHVV_I4xeQkWz9kl-I77v9P3dELniUqRk5crHWm8xx76Cjg-bsbpaC8tq7GE37OAHtKjX4d02RhqBD2LVAigEdsgq3IaqAm4BwZrNJhTPICSR7suuT0CqBG4q8PHZV90M4_Dp1yR3ifc7AOfRdWkDLFHl3NAZLLYxhZw4Lv3ZPzrbO7KuEMHF3Tci4XOsB3E_iBw3NsabWo1ieByfc3UXqgIbK4r7bMENlRfdq1uFkhCx1bHg7xvN3_XeTsdXS2-0PbP3e6wJaFyjpx7gzQhXeND4oGUba0JPvNIV7d_prCTExKPOxMioFRDihywpoLKQxfKjQlrjDrnUS2R1DaF1IAJyLkMUII6rRZ5A2Xo58G9y-_Blel)

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

[](#requirements)

PHP Observer has the following requirements:

- PHP &gt;= 7.3

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

[](#installation)

Execute the Composer `require` command:

```
composer require ngmy/observer
```

Documentation
-------------

[](#documentation)

Please see the [API documentation](https://ngmy.github.io/php-observer/api/).

License
-------

[](#license)

PHP Observer is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

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

Total

2

Last Release

1871d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/864041?v=4)[Yuta Nagamiya](/maintainers/ngmy)[@ngmy](https://github.com/ngmy)

---

Top Contributors

[![ngmy](https://avatars.githubusercontent.com/u/864041?v=4)](https://github.com/ngmy "ngmy (27 commits)")

---

Tags

design-patterneventevent-handlerevent-listenerlibraryobserverobserver-patternphpphp-librarypublisherpubsubsubjectsubscribereventobserverdesign patternsubscriberpubsubpublisherobserver patternevent listenerevent handlersubject

### Embed Badge

![Health badge](/badges/ngmy-observer/health.svg)

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

###  Alternatives

[aura/signal

A SignalSlots/EventHandler implementation; with it, we can invoke handlers ('slots' or 'hooks') whenever an object sends a signal ('notification' or 'event') to the signal manager.

3361.6k4](/packages/aura-signal)

PHPackages © 2026

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