PHPackages                             michaelking0/observers - 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. michaelking0/observers

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

michaelking0/observers
======================

A basic implementation of the observer pattern in PHP

0.1.1(9y ago)018MIT

Since Sep 10Compare

[ Source](https://github.com/MichaelKing0/Observers)[ Packagist](https://packagist.org/packages/michaelking0/observers)[ RSS](/packages/michaelking0-observers/feed)WikiDiscussions Synced yesterday

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

[![Build Status](https://camo.githubusercontent.com/5299b17edf756ce33d082e922880f1b4328235cdebd4007bf78a011af46a445f/68747470733a2f2f7472617669732d63692e6f72672f4d69636861656c4b696e67302f4f62736572766572732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/MichaelKing0/Observers)[![Code Climate](https://camo.githubusercontent.com/c66156859155eeffa746274310be103e890bf7b5530d05aeb6560d0d3b436e71/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4d69636861656c4b696e67302f4f62736572766572732f6261646765732f6770612e737667)](https://codeclimate.com/github/MichaelKing0/Observers)[![SensioLabsInsight](https://camo.githubusercontent.com/4a79e42f7ca85e208975091776006844d54d3c59aa5294d2cde192bcaff82b95/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65303362393664332d356561622d346531322d616434342d6538386462636461323130372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/e03b96d3-5eab-4e12-ad44-e88dbcda2107)

Basic PHP observer pattern implementation
=========================================

[](#basic-php-observer-pattern-implementation)

Usage
-----

[](#usage)

### Installation

[](#installation)

```
composer require michaelking0/observers

```

### Making a class Observable (the subject)

[](#making-a-class-observable-the-subject)

In your subject class, implement the `MichaelKing0\Observers\Interfaces\ObservableInterface` interface. Also, use the trait `MichaelKing0\Observers\Traits\ObservableTrait`.

```
