Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 5, 2024 via composer

symfony/event-dispatcher-contracts v3.4.0

Generic abstractions related to dispatching event
Package summary
Share
0
issues
1
license
2
MIT
Package created
27 May 2019
Version published
23 May 2023
Maintainers
1
Total deps
2
Direct deps
1
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
2 Packages, Including:
psr/event-dispatcher@1.0.0
symfony/event-dispatcher-contracts@v3.4.0
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

1
All Dependencies CSV
β“˜ This is a list of symfony/event-dispatcher-contracts 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
psr/event-dispatcher1.0.04.17 kBMIT
prod

Visualizations

Frequently Asked Questions

What does symfony/event-dispatcher-contracts do?

The Symfony EventDispatcher Contracts package contains a set of abstractions extracted from the Symfony components. Essentially, it is used in dispatching events within a Symfony application, thereby promoting better organized, decoupled, and more manageable code. The advantage of using this package is that it's based on semantics proven useful by the Symfony components, guaranteeing reliability with battle-tested implementations.

How do you use symfony/event-dispatcher-contracts?

The symfony/event-dispatcher-contracts is used in the context of a Symfony application, more commonly in complex applications with a need for an advanced system of communicating between different modular parts of the software. A typical usage might involve creating an Event object class, dispatching the event using the EventDispatcher, and having listeners or subscribers that perform actions when specific events occur. Here is a simple example of how you might use it:

use Symfony\Contracts\EventDispatcher\Event;

class OrderPlacedEvent extends Event
{
    const NAME = 'order.placed';

    // ...
}

$dispatcher = new EventDispatcher();

$listener = new OrderPlacedListener();
$dispatcher->addListener(OrderPlacedEvent::NAME, [$listener, 'onOrderPlaced']);

$event = new OrderPlacedEvent($order);
$dispatcher->dispatch($event, OrderPlacedEvent::NAME);

When the order is placed in this example, OrderPlacedEvent is dispatched and the OrderPlacedListener performs the tasks defined in its onOrderPlaced method.

Where are the symfony/event-dispatcher-contracts docs?

Documentation for the symfony/event-dispatcher-contracts is part of the Symfony framework documentation available online. More specifically, comprehensive information can be found on Symfony's Contracts Github page at this URL: https://github.com/symfony/contracts/blob/main/README.md. In addition to basic instructions, the docs provide valuable insight into how to maximize the utility of this package and generate practical implementations in Symfony applications.