PHPackages                             florianwolters/component-util-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. florianwolters/component-util-observer

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

florianwolters/component-util-observer
======================================

The Observer behavioural design pattern as a PHP component.

07PHP

Since Mar 6Pushed 13y ago1 watchersCompare

[ Source](https://github.com/FlorianWolters/PHP-Component-Util-Observer)[ Packagist](https://packagist.org/packages/florianwolters/component-util-observer)[ RSS](/packages/florianwolters-component-util-observer/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

FlorianWolters\\Component\\Util\\Observer
=========================================

[](#florianwolterscomponentutilobserver)

[![Build Status](https://camo.githubusercontent.com/5cf6384870ae08a4934ddc48b44f4e4eed51e7f381e48924433969a1ea85e0a8/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f466c6f7269616e576f6c746572732f5048502d436f6d706f6e656e742d5574696c2d4f627365727665722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/FlorianWolters/PHP-Component-Util-Observer)

**FlorianWolters\\Component\\Util\\Observer** provides the *Observer* behavioural design pattern as a simple-to-use [PHP](http://php.net "PHP: Hypertext Preprocessor") component.

Introduction
------------

[](#introduction)

*Observer* is a *behavioural* design pattern and defined as follows:

> "Sefine a one-to many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically."

\-- E. Gamma, et al. Design Patterns: Elements of Reusable Object-Oriented software. Westford: Addison-Wesley, 1995.

Features
--------

[](#features)

- Artifacts tested with both static and dynamic test procedures:
    - Dynamic component tests (unit tests) implemented using [PHPUnit](http://phpunit.de "sebastianbergmann/phpunit · GitHub").
    - Static code analysis performed using the following tools:
        - [PHP\_CodeSniffer](http://pear.php.net/package/PHP_CodeSniffer "PHP_CodeSniffer"): Style Checker
        - [PHP Mess Detector (PHPMD)](http://phpmd.org "PHPMD - PHP Mess Detector"): Code Analyzer
        - [phpcpd](https://github.com/sebastianbergmann/phpcpd "sebastianbergmann/phpcpd · GitHub"): Copy/Paste Detector (CPD)
        - [phpdcd](https://github.com/sebastianbergmann/phpdcd "sebastianbergmann/phpdcd · GitHub"): Dead Code Detector (DCD)
- Installable via [Composer](http://getcomposer.org "Composer") or [PEAR installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php "Manual :: Command line installer (PEAR)"):
    - Provides a [Packagist](http://packagist.org "Packagist") package which can be installed using the dependency manager [Composer](http://getcomposer.org "Composer").
        - Click [here](http://packagist.org/packages/florianwolters/component-util-observer "florianwolters/component-util-observer - Packagist") for the package on [Packagist](http://packagist.org "Packagist").
    - Provides a [PEAR package](http://pear.php.net/manual/en/guide.users.concepts.package.php "Manual :: PEAR Packages") which can be installed using the package manager [PEAR installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php "Manual :: Command line installer (PEAR)").
        - Click [here](http://pear.florianwolters.de "PEAR channel of Florian Wolters") for the [PEAR channel](http://pear.php.net/manual/en/guide.users.concepts.channel.php "Manual :: PEAR Channels").
- Provides a complete Application Programming Interface (API) documentation generated with the documentation generator [ApiGen](http://apigen.org "ApiGen | API documentation generator for PHP 5.3.+").
    - Click [here](http://blog.florianwolters.de/PHP-Component-Util-Observer "FlorianWolters\Component\Util\Observer | Application Programming Interface (API) documentation") for the current API documentation.
- Follows the [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md "PSR-0 requirements for autoloader interoperability") requirements for autoloader interoperability.
- Follows the [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md "PSR-1 basic coding style guide") basic coding style guide.
- Follows the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md "PSR-2 coding style guide") coding style guide.
- Follows the [Semantic Versioning](http://semver.org "Semantic Versioning") Specification (SemVer) 2.0.0-rc.1.

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

[](#requirements)

- [PHP](http://php.net "PHP: Hypertext Preprocessor") &gt;=5.4

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

[](#installation)

### Local Installation

[](#local-installation)

**FlorianWolters\\Component\\Util\\Observer** should be installed using the dependency manager [Composer](http://getcomposer.org "Composer"). [Composer](http://getcomposer.org "Composer") can be installed with [PHP](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md "PSR-0 requirements for autoloader interoperability").

```
php -r "eval('?>'.file_get_contents('http://getcomposer.org/installer'));"

```

> This will just check a few [PHP](http://php.net "PHP: Hypertext Preprocessor") settings and then download `composer.phar` to your working directory. This file is the [Composer](http://getcomposer.org "Composer") binary. It is a PHAR ([PHP](http://php.net "PHP: Hypertext Preprocessor") archive), which is an archive format for [PHP](http://php.net "PHP: Hypertext Preprocessor") which can be run on the command line, amongst other things.
>
> Next, run the `install` command to resolve and download dependencies:

```
php composer.phar install

```

### System-Wide Installation

[](#system-wide-installation)

**FlorianWolters\\Component\\Util\\Observer** should be installed using the [PEAR installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php "Manual :: Command line installer (PEAR)"). This installer is the [PHP](http://php.net "PHP: Hypertext Preprocessor") community's de-facto standard for installing [PHP](http://php.net "PHP: Hypertext Preprocessor") components.

```
pear channel-discover pear.florianwolters.de
pear install --alldeps fw/Observer

```

As A Dependency On Your Component
---------------------------------

[](#as-a-dependency-on-your-component)

### Composer

[](#composer)

If you are creating a component that relies on **FlorianWolters\\Component\\Util\\Observer**, please make sure that you add **FlorianWolters\\Component\\Util\\Observer** to your component's `composer.json` file:

```
{
    "require": {
        "florianwolters/component-util-observer": "0.1.*"
    }
}
```

### PEAR

[](#pear)

If you are creating a component that relies on **FlorianWolters\\Component\\Util\\Observer**, please make sure that you add **FlorianWolters\\Component\\Util\\Observer** to your component's `package.xml` file:

```

      Observer
      pear.florianwolters.de
      0.1.0
      0.1.99

```

Usage
-----

[](#usage)

The best documentation for **FlorianWolters\\Component\\Util\\Observer** are the unit tests, which are shipped in the package. You will find them installed into your [PEAR](http://pear.php.net "PEAR - PHP Extension and Application Repository") repository, which on Linux systems is normally `/usr/share/php/test`.

Development Environment
-----------------------

[](#development-environment)

If you want to patch or enhance this component, you will need to create a suitable development environment. The easiest way to do that is to install [phix4componentdev](https://github.com/stuartherbert/phix4componentdev "stuartherbert/phix4componentdev · GitHub"):

```
# phix4componentdev
pear channel-discover pear.phix-project.org
pear install phix/phix4componentdev

```

You can then clone the Git repository:

```
# PHP-Component-Util-Observer
git clone http://github.com/FlorianWolters/PHP-Component-Util-Observer

```

Then, install a local copy of this component's dependencies to complete the development environment:

```
# build vendor/ folder
phing build-vendor

```

To make life easier for you, common tasks (such as running unit tests, generating code review analytics, and creating the [PEAR package](http://pear.php.net/manual/en/guide.users.concepts.package.php "Manual :: PEAR Packages")) have been automated using [phing](http://phing.info "Phing"). You'll find the automated steps inside the `build.xml` file that ships with the component.

Run the command `phing` in the component's top-level folder to see the full list of available automated tasks.

License
-------

[](#license)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see .

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/75dd7e42d69a87c4a0c68b4f29f5d223eb1f9a3f647abafa72da80d2a06d2442?d=identicon)[FlorianWolters](/maintainers/FlorianWolters)

---

Top Contributors

[![FlorianWolters](https://avatars.githubusercontent.com/u/1318837?v=4)](https://github.com/FlorianWolters "FlorianWolters (2 commits)")

### Embed Badge

![Health badge](/badges/florianwolters-component-util-observer/health.svg)

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

###  Alternatives

[trafficcophp/bytebuffer

Node.js inspired byte stream buffer for PHP.

33463.7k18](/packages/trafficcophp-bytebuffer)[synolia/sylius-gdpr-plugin

Synolia sylius GDPR plugin.

21156.4k](/packages/synolia-sylius-gdpr-plugin)[latuconsinafr/3d-bin-packager

PHP Library for 3D Bin Packing.

2865.8k](/packages/latuconsinafr-3d-bin-packager)

PHPackages © 2026

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