Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 9, 2024 via composer

laminas/laminas-eventmanager 3.9.2

Trigger and listen to events within a PHP application
Package summary
Share
0
issues
1
license
1
BSD-3-Clause
Package created
1 Jan 2020
Version published
20 Dec 2022
Maintainers
1
Total deps
1
Direct deps
0
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
laminas/laminas-eventmanager@3.9.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 laminas/laminas-eventmanager 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does laminas/laminas-eventmanager do?

The laminas/laminas-eventmanager composer package serves as a tool for triggering and listening to events within your PHP application. It offers a simplified solution to implementing various design patterns such as the subject/observer pattern, Aspect-Oriented designs and event-driven architectures. It offers a robust architecture that facilitates the attachment and detachment of listeners to named events, either on a per-instance basis or through shared collections. It also offers the ability to trigger events and interrupt listener execution.

How do you use laminas/laminas-eventmanager?

To use laminas/laminas-eventmanager in your PHP project, you need to install it via composer using the command composer require laminas/laminas-eventmanager. After installation, you can create an instance of the EventManager, register events, and then attach and trigger them as needed in your code. Here's a basic code usage example:

use Laminas\EventManager\EventManager;

$events = new EventManager();

// Attach to an event
$events->attach('do', function ($event) {
    $name = $event->getName();
    $params = $event->getParams();
    echo sprintf(
        'Handled event "%s", with parameters %s',
        $name,
        json_encode($params)
    );
});

// Trigger the event
$events->trigger('do', null, ['param1' => 'value1']);

In the above code, an event named 'do' is created and a closure is attached as the listener. The listener simply outputs a message indicating the event name and parameters. Afterwards, the event is triggered with 'param1' set to 'value1'.

Where are the laminas/laminas-eventmanager docs?

The detailed documentation for laminas/laminas-eventmanager can be found on the Laminas Project's official website at https://docs.laminas.dev/laminas-eventmanager/. Here you'll find comprehensive guides and explanations on how to effectively leverage the capabilities this tool provides. If you are migrating from version 2 to version 3 of laminas-eventmanager, there is specific migration documentation available to assist with the transition.