swellphp / admiral Goto Github PK
View Code? Open in Web Editor NEWA PHP Command Bus with Command Handling.
License: MIT License
A PHP Command Bus with Command Handling.
License: MIT License
Initials Setup Tasks:
admiral/src/Admiral/ArrayResolver.php
Line 69 in b839c30
Prepare contribution notes and update the Readme file accordingly.
The Command Bus:
Given an instance of a CommandHandlerResolver
, it should be able to dispatch the command to the Handler
.
Like so:
// An array of commands with handlers.
$commandsWithHandlers = [
Domain\Command\DoSometing::class =>
Domain\Hanlder\DoSomething::class,
Domain\Command\DoSomethingElse::class =>
Domain\Handler\DoSomethingElse::class,
];
$commandBus = new \SwellPhp\Admiral\CommandBus(
new \SwellPhp\Admiral\ArrayResolver($commandsWithHandlers)
);
// Instantiates the command.
$command = new \Domain\Command\DoSometing(
'some',
'parameters'
);
// Dispath a command and it will be handled in the backgound.
$commandBus->dispatch($command)
Resolver
The Resolver is a contract to be implemented by concrete resolvers providing the ability to resolve the CommandHandler class and their dependencies. Initially, one ArrayResolver will exist which takes an array of Commands and their CommandHandlers with an additional array of instantiated (or instantiatable) CommandHandler dependencies. In the future, other concrete resolvers may exist to allow for dependency injection using a framework's container so that it can also resolve interface bindings.
Dev Tasks:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.