reestyle / peavents
Basic event handler
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/reestyle/peavents
Requires
- php: 7.1.0
This package is auto-updated.
Last update: 2025-09-29 03:05:38 UTC
README
Introduction
Peavents stands for PHP events - with a twist. I just thought throwing in a pea would be fun... :)
Peavents is a basic event system. Sort of like a hook system, but slightly different.
Requirements
- PHP 7.0+
This project makes use of datatype type hinting and return value type. Both classes are based on ArrayObject classes.
Installation
Use composer:
$ composer require reestyle/peavents
Remember to use the autoloader.
Basic usage:
$registry = \Peavents\Registry::instance(); $event = $registry->make('event_name'); $event ->setParams(['hello world']) ->attach(function($a) { print $a; }) ->attach(function($a) { print ' - and another ' . $a; }); $registry->raise('event_name');