Recommend this page to a friend! |
Router for flexible configuring of event handling behaviors.
composer require smoren/event-router
composer install
composer test-init
composer test
use Smoren\EventRouter\Components\EventRouter;
use Smoren\EventRouter\Interfaces\EventInterface;
use Smoren\EventRouter\Events\Event;
use Smoren\EventRouter\Structs\EventConfig;
use Smoren\EventRouter\Loggers\ArrayLogger;
$router = new EventRouter(10, new ArrayLogger());
$router
->on(new EventConfig('origin1'), function(EventInterface $event) {
return null;
})
->on(new EventConfig('origin1', 'recursive_single'), function(EventInterface $event) {
return new Event('origin2', 'test');
})
->on(new EventConfig('origin1', 'recursive_multiple'), function(EventInterface $event) {
return [
new Event('origin1', 'recursive_single'),
new Event('origin2', 'test'),
];
})
->on(new EventConfig('origin2'), function(EventInterface $event) {
return null;
});
$router->send(new Event('origin1', 'first'));
Classes of Smoren Freelight | > | Event router | > | Download .zip .tar.gz | > | Support forum | > | Blog | > | Latest changes |
|
Groups | Applications | Files |
Groups |
Algorithms | Numerical and statistical algorithms | View top rated classes |
Libraries | Frameworks and libraries of cooperating classes | View top rated classes |
Language | Constructs to assist in the language control | View top rated classes |
PHP 7 | Classes using PHP 7 specific features | View top rated classes |
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (1 directory) | ||||
src (7 directories) | ||||
tests (3 files, 2 directories) | ||||
codeception.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Components (2 files) | ||||
Events (2 files) | ||||
Exceptions (1 file) | ||||
Interfaces (6 files) | ||||
Links (1 file) | ||||
Loggers (2 files) | ||||
Structs (2 files) |
Files | / | src | / | Components |
File | Role | Description |
---|---|---|
EventRouter.php | Class | Class source |
EventRouterMap.php | Class | Class source |
Files | / | src | / | Events |
File | Role | Description |
---|---|---|
Event.php | Class | Class source |
LinkedEvent.php | Class | Class source |
Files | / | src | / | Interfaces |
File | Role | Description |
---|---|---|
EventConfigInterface.php | Class | Class source |
EventInterface.php | Class | Class source |
EventLinkInterface.php | Class | Class source |
EventRouterInterface.php | Class | Class source |
EventRouteRuleInterface.php | Class | Class source |
LoggerInterface.php | Class | Class source |
Files | / | src | / | Loggers |
File | Role | Description |
---|---|---|
ArrayLogger.php | Class | Class source |
FakeLogger.php | Class | Class source |
Files | / | src | / | Structs |
File | Role | Description |
---|---|---|
EventConfig.php | Class | Class source |
EventRouteRule.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
unit (2 files) | ||||
_support (1 file) | ||||
coding_standard.xml | Data | Auxiliary data | ||
unit.suite.yml | Data | Auxiliary data | ||
_bootstrap.php | Aux. | Auxiliary script |
Files | / | tests | / | unit |
File | Role | Description |
---|---|---|
EventRouterTest.php | Class | Class source |
EventTest.php | Class | Class source |
Download all files: event-router-php.tar.gz event-router-php.zip NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (1 directory) | ||||
src (7 directories) | ||||
tests (3 files, 2 directories) | ||||
codeception.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Components (2 files) | ||||
Events (2 files) | ||||
Exceptions (1 file) | ||||
Interfaces (6 files) | ||||
Links (1 file) | ||||
Loggers (2 files) | ||||
Structs (2 files) |
Files | / | src | / | Components |
File | Role | Description |
---|---|---|
EventRouter.php | Class | Class source |
EventRouterMap.php | Class | Class source |
Files | / | src | / | Events |
File | Role | Description |
---|---|---|
Event.php | Class | Class source |
LinkedEvent.php | Class | Class source |
Files | / | src | / | Interfaces |
File | Role | Description |
---|---|---|
EventConfigInterface.php | Class | Class source |
EventInterface.php | Class | Class source |
EventLinkInterface.php | Class | Class source |
EventRouterInterface.php | Class | Class source |
EventRouteRuleInterface.php | Class | Class source |
LoggerInterface.php | Class | Class source |
Files | / | src | / | Loggers |
File | Role | Description |
---|---|---|
ArrayLogger.php | Class | Class source |
FakeLogger.php | Class | Class source |
Files | / | src | / | Structs |
File | Role | Description |
---|---|---|
EventConfig.php | Class | Class source |
EventRouteRule.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
unit (2 files) | ||||
_support (1 file) | ||||
coding_standard.xml | Data | Auxiliary data | ||
unit.suite.yml | Data | Auxiliary data | ||
_bootstrap.php | Aux. | Auxiliary script |
Files | / | tests | / | unit |
File | Role | Description |
---|---|---|
EventRouterTest.php | Class | Class source |
EventTest.php | Class | Class source |
Download all files: event-router-php.tar.gz event-router-php.zip NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|