Skip to content

Commit

Permalink
Docblock improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstuck committed Feb 4, 2015
1 parent b6f4a2c commit b995e06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/2-intermediate-create-middleware.php
Expand Up @@ -49,7 +49,7 @@ public function execute(Command $command, callable $next)
}
}
// Some things to note:
// - we can execute logic before _or_ after a Command is executed by hyst
// - we can execute logic before _or_ after a Command is executed by
// changing where we call $next($command).
// - Tactician allows a Handler to return a value if we want, so we capture
// it here to return after we finish logging. This isn't required, but it
Expand Down
12 changes: 12 additions & 0 deletions src/Middleware.php
Expand Up @@ -2,9 +2,21 @@
namespace League\Tactician;

/**
* Middleware are the plugins of Tactician. They receive each command that's
* given to the CommandBus and can take any action they choose. Middleware can
* continue the Command processing by passing the command they receive to the
* $next callable, which is essentially the "next" Middleware in the chain.
*
* Depending on where they invoke the $next callable, Middleware can execute
* their custom logic before or after the Command is handled. They can also
* modify, log, or replace the command they receive. The sky's the limit.
*/
interface Middleware
{
/**
* @param Command $command
* @param callable $next
* @return mixed
*/
public function execute(Command $command, callable $next);
}

0 comments on commit b995e06

Please sign in to comment.