Download the PHP package icanboogie/bind-message-bus without Composer
On this page you can find all versions of the php package icanboogie/bind-message-bus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download icanboogie/bind-message-bus
More information about icanboogie/bind-message-bus
Files in icanboogie/bind-message-bus
Package bind-message-bus
Short Description Binds icanboogie/message-bus to ICanBoogie
License BSD-3-Clause
Homepage https://icanboogie.org/
Informations about the package bind-message-bus
bind-message-bus
The icanboogie/bind-message-bus package binds icanboogie/message-bus to ICanBoogie.
Bindings
Application bindings
The following getters are added to the Application class:
message_bus
: A Dispatcher instance created with$app->message_handler_provider
and$app->message_pusher
.message_handler_provider
: A HandlerProvider instance configured with themessage-bus-handlers
config.
Controller bindings
The following method is added to the Controller class:
mixed dispatch_message($message)
: Dispatch a message using$this->app->command_bus
.
Use the ControllerBindings trait with your controller to type hint the bindings.
Configuration
The message-bus
config is used to configure the message bus. Message handlers are defined with an
array of key/pair values with key MessageBusConfig::HANDLERS
, where key is a message class and
value its handler (a callable).
The following example demonstrates how to match messages with handler references. The
icanboogie/service package provides the ref()
method used to define the references:
Requirements
The package requires PHP 7.2 or later.
Installation
Documentation
The package is documented as part of the ICanBoogie framework documentation. You can
generate the documentation for the package and its dependencies with the make doc
command. The
documentation is generated in the build/docs
directory. ApiGen is required.
The directory can later be cleaned with the make clean
command.
Testing
Run make test-container
to create and log into the test container, then run make test
to run the
test suite. Alternatively, run make test-coverage
to run the test suite with test coverage. Open
build/coverage/index.html
to see the breakdown of the code coverage.
License
icanboogie/bind-message-bus is released under the New BSD License.