Added workflow draft

This commit is contained in:
Kevin Frantz 2018-09-05 19:52:21 +02:00
parent caa5f9aec4
commit 05e87bdfcc
4 changed files with 112 additions and 0 deletions

View File

@ -0,0 +1,49 @@
<?php
namespace Controller\workflow;
use App\Controller\workflow\WorkflowInterface;
use App\Entity\NodeInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
*
* @author kevinfrantz
*
*/
abstract class AbstractWorkflow implements WorkflowInterface
{
protected $type = 'html';
protected $response;
protected $request;
public function __construct(Request $request){}
abstract protected function handlePost():void;
abstract protected function handleGet():void;
private function setType():void{}
public function work(): void
{
$this->response = new Response();
$this->setType();
$this->handlePost();
$this->handleGet();
}
public function setReguest(Request $request): void
{
}
public function getReponse(): Response
{}
public function setWorker(NodeInterface $worker): void
{}
}

View File

@ -0,0 +1,20 @@
<?php
namespace Controller\workflow;
/**
*
* @author kevinfrantz
*
*/
class LoginWorkflow extends AbstractWorkflow
{
protected function handleGet(): void
{
}
protected function handlePost(): void
{}
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Controller\workflow;
use Controller\workflow\AbstractWorkflow;
/**
*
* @author kevinfrantz
*
*/
class LogoutWorkflow extends AbstractWorkflow
{
protected function handleGet(): void
{}
protected function handlePost(): void
{}
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Controller\workflow;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use App\Entity\NodeInterface;
/**
*
* @author kevinfrantz
*
*/
interface WorkflowInterface
{
public function setWorker(NodeInterface $worker):void;
public function setReguest(Request $request):void;
public function work():void;
public function getReponse():Response;
}