Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ngmy/php-observer

A PHP library to implement the observer pattern
https://github.com/ngmy/php-observer

design-pattern event event-handler event-listener library observer observer-pattern php php-library publisher pubsub subject subscriber

Last synced: about 2 months ago
JSON representation

A PHP library to implement the observer pattern

Awesome Lists containing this project

README

        

# PHP Observer
[![Latest Stable Version](https://poser.pugx.org/ngmy/observer/v)](//packagist.org/packages/ngmy/observer)
[![Total Downloads](https://poser.pugx.org/ngmy/observer/downloads)](//packagist.org/packages/ngmy/observer)
[![Latest Unstable Version](https://poser.pugx.org/ngmy/observer/v/unstable)](//packagist.org/packages/ngmy/observer)
[![License](https://poser.pugx.org/ngmy/observer/license)](//packagist.org/packages/ngmy/observer)
[![composer.lock](https://poser.pugx.org/ngmy/observer/composerlock)](//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://coveralls.io/repos/github/ngmy/php-observer/badge.svg?branch=master)](https://coveralls.io/github/ngmy/php-observer?branch=master)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)
[![Psalm Coverage](https://shepherd.dev/github/ngmy/php-observer/coverage.svg?)](https://shepherd.dev/github/ngmy/php-observer)
[![Psalm Level](https://shepherd.dev/github/ngmy/php-observer/level.svg?)](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](http://www.plantuml.com/plantuml/png/hL71hfim4BpxArQ80_I9Gw-qHP7w0Jta2mmimPMnK-yIfQhoxxLb38bxoAMSsDtPcPtnYLWwNXSjs5w1BVIMsIumAeS3Ask4a3snamF3UUr_-YRy4G2DLiHVV_I4xeQkWz9kl-I77v9P3dELniUqRk5crHWm8xx76Cjg-bsbpaC8tq7GE37OAHtKjX4d02RhqBD2LVAigEdsgq3IaqAm4BwZrNJhTPICSR7suuT0CqBG4q8PHZV90M4_Dp1yR3ifc7AOfRdWkDLFHl3NAZLLYxhZw4Lv3ZPzrbO7KuEMHF3Tci4XOsB3E_iBw3NsabWo1ieByfc3UXqgIbK4r7bMENlRfdq1uFkhCx1bHg7xvN3_XeTsdXS2-0PbP3e6wJaFyjpx7gzQhXeND4oGUba0JPvNIV7d_prCTExKPOxMioFRDihywpoLKQxfKjQlrjDrnUS2R1DaF1IAJyLkMUII6rRZ5A2Xo58G9y-_Blel)](http://www.plantuml.com/plantuml/uml/hL71hfim4BpxArQ80_I9Gw-qHP7w0Jta2mmimPMnK-yIfQhoxxLb38bxoAMSsDtPcPtnYLWwNXSjs5w1BVIMsIumAeS3Ask4a3snamF3UUr_-YRy4G2DLiHVV_I4xeQkWz9kl-I77v9P3dELniUqRk5crHWm8xx76Cjg-bsbpaC8tq7GE37OAHtKjX4d02RhqBD2LVAigEdsgq3IaqAm4BwZrNJhTPICSR7suuT0CqBG4q8PHZV90M4_Dp1yR3ifc7AOfRdWkDLFHl3NAZLLYxhZw4Lv3ZPzrbO7KuEMHF3Tci4XOsB3E_iBw3NsabWo1ieByfc3UXqgIbK4r7bMENlRfdq1uFkhCx1bHg7xvN3_XeTsdXS2-0PbP3e6wJaFyjpx7gzQhXeND4oGUba0JPvNIV7d_prCTExKPOxMioFRDihywpoLKQxfKjQlrjDrnUS2R1DaF1IAJyLkMUII6rRZ5A2Xo58G9y-_Blel)

## Requirements
PHP Observer has the following requirements:

* PHP >= 7.3

## Installation
Execute the Composer `require` command:
```console
composer require ngmy/observer
```

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

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