Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
add abstract action usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
kpicaza committed Oct 28, 2017
1 parent b600bfa commit 14e3402
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
@@ -1,9 +1,8 @@
# infw zend-expressive Tactician adapter
# Zend-expressive Tactician adapter

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kpicaza/infw-tactician-adapter/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kpicaza/infw-tactician-adapter/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/kpicaza/infw-tactician-adapter/badges/build.png?b=master)](https://scrutinizer-ci.com/g/kpicaza/infw-tactician-adapter/build-status/master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/c6b276fe-849b-41b7-b78e-4a4342a9b274/mini.png)](https://insight.sensiolabs.com/projects/c6b276fe-849b-41b7-b78e-4a4342a9b274)

[League tactician](http://tactician.thephpleague.com/) command bus adapter for [zend-expressive framework](https://docs.zendframework.com/zend-expressive/).

## Getting started
Expand Down Expand Up @@ -71,6 +70,28 @@ class PingHandler
````

You can use `InFw\TacticianAdapter\Action\AbstractAction` as base action.

````
<?php
namespace App\Action;
use App\Command\PingCommand;
use InFw\TacticianAdapter\Action\AbstractAction;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Zend\Diactoros\Response\JsonResponse;
use Psr\Http\Message\ServerRequestInterface;
class PingAction extends AbstractAction
{
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
{
return new JsonResponse(['ack' => $this->bus->handle(new PingCommand())]);
}
}
````

## Override Command Bus

You can modify the entire command bus to meet the needs of your project.
Expand Down

0 comments on commit 14e3402

Please sign in to comment.