Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via composer

evenement/evenement v3.0.2

Événement is a very simple event dispatching library for PHP
Package summary
Share
0
issues
1
license
1
MIT
Package created
8 Oct 2011
Version published
8 Aug 2023
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
evenement/evenement@v3.0.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
ⓘ This is a list of evenement/evenement 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does evenement/evenement do?

The evenement/evenement package is an incredibly straightforward event dispatching library for PHP, inspired by the EventEmitter API found in Node.js. Its primary aim is to empower users whilst maintaining simplicity and conciseness, mimicking the design goals of Silex and Pimple. It gives PHP developers the power to easily handle the propagation of events in their applications.

How do you use evenement/evenement?

Let's delve into how to use the evenement/evenement library. Installation is simple using composer. Run this command in your terminal:

composer require evenement/evenement

Now, to create an Emitter:

<?php
$emitter = new Evenement\EventEmitter();

To add listeners to specific events, use the on method:

<?php
$emitter->on('user.created', function (User $user) use ($logger) {
    $logger->log(sprintf("User '%s' was created.", $user->getLogin()));
});

To remove these listeners, the removeListener function is used:

<?php
$emitter->removeListener('user.created', function (User $user) use ($logger) {
    $logger->log(sprintf("User '%s' was created.", $user->getLogin()));
});

Finally, to emit the events, you would use the emit function as follows:

<?php
$emitter->emit('user.created', [$user]);

Where are the evenement/evenement docs?

The documentation for the evenement/evenement library can be found directly within the README file on the GitHub page: [another note, unfortunately in this case, the readme only contains basic setup and usage, not further documentation]. However, the usage examples and brief explanation of the system's functionality provide an impressive and useful guide to getting started with the library.