Renamed JsonErrorHandler to JsonErrorResponseGenerator

This commit is contained in:
Alejandro Celaya 2017-03-25 09:46:29 +01:00
parent cd47aae902
commit 288249d0b8
3 changed files with 7 additions and 7 deletions

View file

@ -1,12 +1,12 @@
<?php
use Shlinkio\Shlink\Rest\ErrorHandler\JsonErrorHandler;
use Shlinkio\Shlink\Rest\ErrorHandler\JsonErrorResponseGenerator;
return [
'error_handler' => [
'plugins' => [
'invokables' => [
'application/json' => JsonErrorHandler::class,
'application/json' => JsonErrorResponseGenerator::class,
],
'aliases' => [
'application/x-json' => 'application/json',

View file

@ -8,7 +8,7 @@ use Psr\Http\Message\ServerRequestInterface as Request;
use Zend\Diactoros\Response\JsonResponse;
use Zend\Expressive\Router\RouteResult;
class JsonErrorHandler implements ErrorResponseGeneratorInterface, StatusCodeInterface
class JsonErrorResponseGenerator implements ErrorResponseGeneratorInterface, StatusCodeInterface
{
/**
* Final handler for an application.

View file

@ -2,20 +2,20 @@
namespace ShlinkioTest\Shlink\Rest\ErrorHandler;
use PHPUnit\Framework\TestCase;
use Shlinkio\Shlink\Rest\ErrorHandler\JsonErrorHandler;
use Shlinkio\Shlink\Rest\ErrorHandler\JsonErrorResponseGenerator;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
class JsonErrorHandlerTest extends TestCase
class JsonErrorResponseGeneratorTest extends TestCase
{
/**
* @var JsonErrorHandler
* @var JsonErrorResponseGenerator
*/
protected $errorHandler;
public function setUp()
{
$this->errorHandler = new JsonErrorHandler();
$this->errorHandler = new JsonErrorResponseGenerator();
}
/**