bmack / kart-composer-plugin
An composer plugin to fetch listeners provided by composer packages
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: ^7.2
- composer-plugin-api: ^1.1
- psr/event-dispatcher: ^1.0
- roave/better-reflection: ^3.2
Requires (Dev)
- composer/composer: ^1.8
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-10-28 04:46:58 UTC
README
What does it do?
This package is a composer plugin that hooks before "dump autoload", generates a PHP class which contains Listeners that are simply registered by the "extra" section.
"extra": {
"psr-14": {
"default": "src/Listeners"
}
}
This folder usually then contains listener classes/functions for PSR-14 events.
Once installed, all listeners are added to a class called
Bmack\KartComposerPlugin\ComposerReflectionListenerProvider
which implements
the PSR-14 ListenerProvider
interface.
This is based on roave/better-reflection
.
Due to composer's dependency tree, all listeners are loaded and executed based on their dependencies for a certain event.
Usage
- Install the composer plugin or any package that depends on the package.
- Add the ListenerProvider to your dispatcher implementation.
License
MIT
Author
Benni Mack, 2019