Fixed Action prefix on routable middlewares

This commit is contained in:
Alejandro Celaya 2016-07-27 20:22:50 +02:00
parent a3554db1c3
commit 36259588db
12 changed files with 25 additions and 29 deletions

View file

@ -11,10 +11,6 @@ php:
- 7.1
- hhvm
matrix:
allow_failures:
- hhvm
before_script:
- composer self-update
- composer install --no-interaction

View file

@ -1,5 +1,5 @@
<?php
use Shlinkio\Shlink\Core\Action\RedirectMiddleware;
use Shlinkio\Shlink\Core\Action\RedirectAction;
return [
@ -7,7 +7,7 @@ return [
[
'name' => 'long-url-redirect',
'path' => '/{shortCode}',
'middleware' => RedirectMiddleware::class,
'middleware' => RedirectAction::class,
'allowed_methods' => ['GET'],
],
],

View file

@ -1,6 +1,6 @@
<?php
use Acelaya\ZsmAnnotatedServices\Factory\V3\AnnotatedFactory;
use Shlinkio\Shlink\Core\Action\RedirectMiddleware;
use Shlinkio\Shlink\Core\Action\RedirectAction;
use Shlinkio\Shlink\Core\Service;
return [
@ -14,7 +14,7 @@ return [
Service\VisitService::class => AnnotatedFactory::class,
// Middleware
RedirectMiddleware::class => AnnotatedFactory::class,
RedirectAction::class => AnnotatedFactory::class,
],
],

View file

@ -11,7 +11,7 @@ use Shlinkio\Shlink\Core\Service\VisitsTrackerInterface;
use Zend\Diactoros\Response\RedirectResponse;
use Zend\Stratigility\MiddlewareInterface;
class RedirectMiddleware implements MiddlewareInterface
class RedirectAction implements MiddlewareInterface
{
/**
* @var UrlShortenerInterface

View file

@ -7,31 +7,31 @@ return [
[
'name' => 'rest-authenticate',
'path' => '/rest/authenticate',
'middleware' => Action\AuthenticateMiddleware::class,
'middleware' => Action\AuthenticateAction::class,
'allowed_methods' => ['POST', 'OPTIONS'],
],
[
'name' => 'rest-create-shortcode',
'path' => '/rest/short-codes',
'middleware' => Action\CreateShortcodeMiddleware::class,
'middleware' => Action\CreateShortcodeAction::class,
'allowed_methods' => ['POST', 'OPTIONS'],
],
[
'name' => 'rest-resolve-url',
'path' => '/rest/short-codes/{shortCode}',
'middleware' => Action\ResolveUrlMiddleware::class,
'middleware' => Action\ResolveUrlAction::class,
'allowed_methods' => ['GET', 'OPTIONS'],
],
[
'name' => 'rest-list-shortened-url',
'path' => '/rest/short-codes',
'middleware' => Action\ListShortcodesMiddleware::class,
'middleware' => Action\ListShortcodesAction::class,
'allowed_methods' => ['GET'],
],
[
'name' => 'rest-get-visits',
'path' => '/rest/short-codes/{shortCode}/visits',
'middleware' => Action\GetVisitsMiddleware::class,
'middleware' => Action\GetVisitsAction::class,
'allowed_methods' => ['GET', 'OPTIONS'],
],
],

View file

@ -11,11 +11,11 @@ return [
'factories' => [
Service\RestTokenService::class => AnnotatedFactory::class,
Action\AuthenticateMiddleware::class => AnnotatedFactory::class,
Action\CreateShortcodeMiddleware::class => AnnotatedFactory::class,
Action\ResolveUrlMiddleware::class => AnnotatedFactory::class,
Action\GetVisitsMiddleware::class => AnnotatedFactory::class,
Action\ListShortcodesMiddleware::class => AnnotatedFactory::class,
Action\AuthenticateAction::class => AnnotatedFactory::class,
Action\CreateShortcodeAction::class => AnnotatedFactory::class,
Action\ResolveUrlAction::class => AnnotatedFactory::class,
Action\GetVisitsAction::class => AnnotatedFactory::class,
Action\ListShortcodesAction::class => AnnotatedFactory::class,
Middleware\CrossDomainMiddleware::class => InvokableFactory::class,
Middleware\CheckAuthenticationMiddleware::class => AnnotatedFactory::class,

View file

@ -5,7 +5,7 @@ use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Zend\Stratigility\MiddlewareInterface;
abstract class AbstractRestMiddleware implements MiddlewareInterface
abstract class AbstractRestAction implements MiddlewareInterface
{
/**
* Process an incoming request and/or response.

View file

@ -11,7 +11,7 @@ use Shlinkio\Shlink\Rest\Util\RestUtils;
use Zend\Diactoros\Response\JsonResponse;
use Zend\I18n\Translator\TranslatorInterface;
class AuthenticateMiddleware extends AbstractRestMiddleware
class AuthenticateAction extends AbstractRestAction
{
/**
* @var RestTokenServiceInterface
@ -23,7 +23,7 @@ class AuthenticateMiddleware extends AbstractRestMiddleware
private $translator;
/**
* AuthenticateMiddleware constructor.
* AuthenticateAction constructor.
* @param RestTokenServiceInterface|RestTokenService $restTokenService
* @param TranslatorInterface $translator
*

View file

@ -12,7 +12,7 @@ use Zend\Diactoros\Response\JsonResponse;
use Zend\Diactoros\Uri;
use Zend\I18n\Translator\TranslatorInterface;
class CreateShortcodeMiddleware extends AbstractRestMiddleware
class CreateShortcodeAction extends AbstractRestAction
{
/**
* @var UrlShortener|UrlShortenerInterface

View file

@ -12,7 +12,7 @@ use Shlinkio\Shlink\Rest\Util\RestUtils;
use Zend\Diactoros\Response\JsonResponse;
use Zend\I18n\Translator\TranslatorInterface;
class GetVisitsMiddleware extends AbstractRestMiddleware
class GetVisitsAction extends AbstractRestAction
{
/**
* @var VisitsTrackerInterface
@ -24,7 +24,7 @@ class GetVisitsMiddleware extends AbstractRestMiddleware
private $translator;
/**
* GetVisitsMiddleware constructor.
* GetVisitsAction constructor.
* @param VisitsTrackerInterface|VisitsTracker $visitsTracker
* @param TranslatorInterface $translator
*

View file

@ -11,7 +11,7 @@ use Shlinkio\Shlink\Rest\Util\RestUtils;
use Zend\Diactoros\Response\JsonResponse;
use Zend\I18n\Translator\TranslatorInterface;
class ListShortcodesMiddleware extends AbstractRestMiddleware
class ListShortcodesAction extends AbstractRestAction
{
use PaginatorUtilsTrait;
@ -25,7 +25,7 @@ class ListShortcodesMiddleware extends AbstractRestMiddleware
private $translator;
/**
* ListShortcodesMiddleware constructor.
* ListShortcodesAction constructor.
* @param ShortUrlServiceInterface|ShortUrlService $shortUrlService
* @param TranslatorInterface $translator
*

View file

@ -11,7 +11,7 @@ use Shlinkio\Shlink\Rest\Util\RestUtils;
use Zend\Diactoros\Response\JsonResponse;
use Zend\I18n\Translator\TranslatorInterface;
class ResolveUrlMiddleware extends AbstractRestMiddleware
class ResolveUrlAction extends AbstractRestAction
{
/**
* @var UrlShortenerInterface
@ -23,7 +23,7 @@ class ResolveUrlMiddleware extends AbstractRestMiddleware
private $translator;
/**
* ResolveUrlMiddleware constructor.
* ResolveUrlAction constructor.
* @param UrlShortenerInterface|UrlShortener $urlShortener
* @param TranslatorInterface $translator
*