Initial commit
This commit is contained in:
25
src/App/Action/KanbanAction.php
Normal file
25
src/App/Action/KanbanAction.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Action;
|
||||
|
||||
use App\Service\DataCollectorService;
|
||||
use Interop\Http\ServerMiddleware\DelegateInterface;
|
||||
use Interop\Http\ServerMiddleware\MiddlewareInterface as ServerMiddlewareInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class KanbanAction implements ServerMiddlewareInterface
|
||||
{
|
||||
private $dataCollector;
|
||||
|
||||
public function __construct(DataCollectorService $dataCollectorService)
|
||||
{
|
||||
$this->dataCollector = $dataCollectorService;
|
||||
}
|
||||
|
||||
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
|
||||
{
|
||||
$kanbanResult = $this->dataCollector->getKanbanBoard();
|
||||
return new JsonResponse($kanbanResult);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user