for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Lib\Slime\RestAction;
use App\Lib\Slime\Interfaces\UseCase\IAction;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
abstract class Action implements IAction
{
protected $args;
protected $request;
protected $response;
public function __construct(
RequestInterface $request = null,
ResponseInterface $response = null,
array $args = []
)
$this->args = $args;
$this->request = $request;
$this->response = $response;
}
public function dispatch()
$this->init();
$this->performChecks();
$this->performAction();
$this->performCallBack();
$this->formatResponse();
return $this->response;
protected abstract function init();
protected abstract function performChecks();
protected abstract function performAction();
protected abstract function performCallBack();
protected abstract function formatResponse();