Added property types to all non-deprecated classes

This commit is contained in:
Alejandro Celaya 2019-12-29 22:48:40 +01:00
parent b904c6d00d
commit a830420d75
66 changed files with 122 additions and 231 deletions

View File

@ -9,8 +9,7 @@ use Shlinkio\Shlink\Core\Config\BasePathPrefixer;
class BasePathPrefixerTest extends TestCase
{
/** @var BasePathPrefixer */
private $prefixer;
private BasePathPrefixer $prefixer;
public function setUp(): void
{

View File

@ -11,8 +11,7 @@ use function array_merge;
class DeprecatedConfigParserTest extends TestCase
{
/** @var DeprecatedConfigParser */
private $postProcessor;
private DeprecatedConfigParser $postProcessor;
public function setUp(): void
{

View File

@ -13,10 +13,8 @@ use Shlinkio\Shlink\Core\Entity\Domain;
class PersistenceDomainResolverTest extends TestCase
{
/** @var PersistenceDomainResolver */
private $domainResolver;
/** @var ObjectProphecy */
private $em;
private PersistenceDomainResolver $domainResolver;
private ObjectProphecy $em;
public function setUp(): void
{

View File

@ -10,8 +10,7 @@ use Shlinkio\Shlink\Core\Entity\Domain;
class SimpleDomainResolverTest extends TestCase
{
/** @var SimpleDomainResolver */
private $domainResolver;
private SimpleDomainResolver $domainResolver;
public function setUp(): void
{

View File

@ -19,10 +19,8 @@ use Zend\Expressive\Router\RouteResult;
class NotFoundRedirectHandlerTest extends TestCase
{
/** @var NotFoundRedirectHandler */
private $middleware;
/** @var NotFoundRedirectOptions */
private $redirectOptions;
private NotFoundRedirectHandler $middleware;
private NotFoundRedirectOptions $redirectOptions;
public function setUp(): void
{

View File

@ -17,10 +17,8 @@ use Zend\Expressive\Template\TemplateRendererInterface;
class NotFoundTemplateHandlerTest extends TestCase
{
/** @var NotFoundTemplateHandler */
private $handler;
/** @var ObjectProphecy */
private $renderer;
private NotFoundTemplateHandler $handler;
private ObjectProphecy $renderer;
public function setUp(): void
{

View File

@ -27,18 +27,12 @@ use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
class LocateShortUrlVisitTest extends TestCase
{
/** @var LocateShortUrlVisit */
private $locateVisit;
/** @var ObjectProphecy */
private $ipLocationResolver;
/** @var ObjectProphecy */
private $em;
/** @var ObjectProphecy */
private $logger;
/** @var ObjectProphecy */
private $dbUpdater;
/** @var ObjectProphecy */
private $eventDispatcher;
private LocateShortUrlVisit $locateVisit;
private ObjectProphecy $ipLocationResolver;
private ObjectProphecy $em;
private ObjectProphecy $logger;
private ObjectProphecy $dbUpdater;
private ObjectProphecy $eventDispatcher;
public function setUp(): void
{

View File

@ -16,10 +16,8 @@ use Zend\Diactoros\Uri;
class QrCodeCacheMiddlewareTest extends TestCase
{
/** @var QrCodeCacheMiddleware */
private $middleware;
/** @var Cache */
private $cache;
private QrCodeCacheMiddleware $middleware;
private Cache $cache;
public function setUp(): void
{

View File

@ -13,8 +13,7 @@ use Shlinkio\Shlink\Core\Repository\ShortUrlRepositoryInterface;
class ShortUrlRepositoryAdapterTest extends TestCase
{
/** @var ObjectProphecy */
private $repo;
private ObjectProphecy $repo;
public function setUp(): void
{

View File

@ -23,10 +23,8 @@ use function sprintf;
class DeleteShortUrlServiceTest extends TestCase
{
/** @var ObjectProphecy */
private $em;
/** @var string */
private $shortCode;
private ObjectProphecy $em;
private string $shortCode;
public function setUp(): void
{

View File

@ -21,10 +21,8 @@ use function count;
class ShortUrlServiceTest extends TestCase
{
/** @var ShortUrlService */
private $service;
/** @var ObjectProphecy|EntityManagerInterface */
private $em;
private ShortUrlService $service;
private ObjectProphecy $em;
public function setUp(): void
{

View File

@ -17,10 +17,8 @@ use Shlinkio\Shlink\Core\Service\Tag\TagService;
class TagServiceTest extends TestCase
{
/** @var TagService */
private $service;
/** @var ObjectProphecy */
private $em;
private TagService $service;
private ObjectProphecy $em;
public function setUp(): void
{

View File

@ -27,12 +27,9 @@ use function array_map;
class UrlShortenerTest extends TestCase
{
/** @var UrlShortener */
private $urlShortener;
/** @var ObjectProphecy */
private $em;
/** @var ObjectProphecy */
private $urlValidator;
private UrlShortener $urlShortener;
private ObjectProphecy $em;
private ObjectProphecy $urlValidator;
public function setUp(): void
{

View File

@ -28,10 +28,8 @@ use function sprintf;
class VisitServiceTest extends TestCase
{
/** @var VisitService */
private $visitService;
/** @var ObjectProphecy */
private $em;
private VisitService $visitService;
private ObjectProphecy $em;
public function setUp(): void
{

View File

@ -23,12 +23,9 @@ use Zend\Stdlib\ArrayUtils;
class VisitsTrackerTest extends TestCase
{
/** @var VisitsTracker */
private $visitsTracker;
/** @var ObjectProphecy */
private $em;
/** @var EventDispatcherInterface */
private $eventDispatcher;
private VisitsTracker $visitsTracker;
private ObjectProphecy $em;
private ObjectProphecy $eventDispatcher;
public function setUp(): void
{

View File

@ -14,8 +14,7 @@ use function random_int;
class ShortUrlDataTransformerTest extends TestCase
{
/** @var ShortUrlDataTransformer */
private $transformer;
private ShortUrlDataTransformer $transformer;
public function setUp(): void
{

View File

@ -17,10 +17,8 @@ use Zend\Diactoros\Response;
class UrlValidatorTest extends TestCase
{
/** @var UrlValidator */
private $urlValidator;
/** @var ObjectProphecy */
private $httpClient;
private UrlValidator $urlValidator;
private ObjectProphecy $httpClient;
public function setUp(): void
{

View File

@ -17,8 +17,7 @@ abstract class AbstractRestAction implements RequestHandlerInterface, RequestMet
protected const ROUTE_PATH = '';
protected const ROUTE_ALLOWED_METHODS = [];
/** @var LoggerInterface */
protected $logger;
protected LoggerInterface $logger;
public function __construct(?LoggerInterface $logger = null)
{

View File

@ -21,10 +21,8 @@ class HealthAction extends AbstractRestAction
protected const ROUTE_PATH = '/health';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET];
/** @var AppOptions */
private $options;
/** @var Connection */
private $conn;
private AppOptions $options;
private Connection $conn;
public function __construct(Connection $conn, AppOptions $options, ?LoggerInterface $logger = null)
{

View File

@ -16,10 +16,8 @@ use Zend\Diactoros\Response\JsonResponse;
abstract class AbstractCreateShortUrlAction extends AbstractRestAction
{
/** @var UrlShortenerInterface */
private $urlShortener;
/** @var array */
private $domainConfig;
private UrlShortenerInterface $urlShortener;
private array $domainConfig;
public function __construct(
UrlShortenerInterface $urlShortener,

View File

@ -16,8 +16,7 @@ class DeleteShortUrlAction extends AbstractRestAction
protected const ROUTE_PATH = '/short-urls/{shortCode}';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_DELETE];
/** @var DeleteShortUrlServiceInterface */
private $deleteShortUrlService;
private DeleteShortUrlServiceInterface $deleteShortUrlService;
public function __construct(DeleteShortUrlServiceInterface $deleteShortUrlService, ?LoggerInterface $logger = null)
{

View File

@ -17,8 +17,7 @@ class EditShortUrlAction extends AbstractRestAction
protected const ROUTE_PATH = '/short-urls/{shortCode}';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_PATCH, self::METHOD_PUT];
/** @var ShortUrlServiceInterface */
private $shortUrlService;
private ShortUrlServiceInterface $shortUrlService;
public function __construct(ShortUrlServiceInterface $shortUrlService, ?LoggerInterface $logger = null)
{

View File

@ -17,8 +17,7 @@ class EditShortUrlTagsAction extends AbstractRestAction
protected const ROUTE_PATH = '/short-urls/{shortCode}/tags';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_PUT];
/** @var ShortUrlServiceInterface */
private $shortUrlService;
private ShortUrlServiceInterface $shortUrlService;
public function __construct(ShortUrlServiceInterface $shortUrlService, ?LoggerInterface $logger = null)
{

View File

@ -23,10 +23,8 @@ class ListShortUrlsAction extends AbstractRestAction
protected const ROUTE_PATH = '/short-urls';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET];
/** @var ShortUrlServiceInterface */
private $shortUrlService;
/** @var array */
private $domainConfig;
private ShortUrlServiceInterface $shortUrlService;
private array $domainConfig;
public function __construct(
ShortUrlServiceInterface $shortUrlService,

View File

@ -18,10 +18,8 @@ class ResolveShortUrlAction extends AbstractRestAction
protected const ROUTE_PATH = '/short-urls/{shortCode}';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET];
/** @var UrlShortenerInterface */
private $urlShortener;
/** @var array */
private $domainConfig;
private UrlShortenerInterface $urlShortener;
private array $domainConfig;
public function __construct(
UrlShortenerInterface $urlShortener,

View File

@ -17,8 +17,7 @@ class SingleStepCreateShortUrlAction extends AbstractCreateShortUrlAction
protected const ROUTE_PATH = '/short-urls/shorten';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET];
/** @var ApiKeyServiceInterface */
private $apiKeyService;
private ApiKeyServiceInterface $apiKeyService;
public function __construct(
UrlShortenerInterface $urlShortener,

View File

@ -16,8 +16,7 @@ class CreateTagsAction extends AbstractRestAction
protected const ROUTE_PATH = '/tags';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_POST];
/** @var TagServiceInterface */
private $tagService;
private TagServiceInterface $tagService;
public function __construct(TagServiceInterface $tagService, ?LoggerInterface $logger = null)
{

View File

@ -16,8 +16,7 @@ class DeleteTagsAction extends AbstractRestAction
protected const ROUTE_PATH = '/tags';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_DELETE];
/** @var TagServiceInterface */
private $tagService;
private TagServiceInterface $tagService;
public function __construct(TagServiceInterface $tagService, ?LoggerInterface $logger = null)
{

View File

@ -16,8 +16,7 @@ class ListTagsAction extends AbstractRestAction
protected const ROUTE_PATH = '/tags';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET];
/** @var TagServiceInterface */
private $tagService;
private TagServiceInterface $tagService;
public function __construct(TagServiceInterface $tagService, ?LoggerInterface $logger = null)
{

View File

@ -17,8 +17,7 @@ class UpdateTagAction extends AbstractRestAction
protected const ROUTE_PATH = '/tags';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_PUT];
/** @var TagServiceInterface */
private $tagService;
private TagServiceInterface $tagService;
public function __construct(TagServiceInterface $tagService, ?LoggerInterface $logger = null)
{

View File

@ -20,8 +20,7 @@ class GetVisitsAction extends AbstractRestAction
protected const ROUTE_PATH = '/short-urls/{shortCode}/visits';
protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET];
/** @var VisitsTrackerInterface */
private $visitsTracker;
private VisitsTrackerInterface $visitsTracker;
public function __construct(VisitsTrackerInterface $visitsTracker, ?LoggerInterface $logger = null)
{

View File

@ -13,8 +13,7 @@ class ApiKeyHeaderPlugin implements AuthenticationPluginInterface
{
public const HEADER_NAME = 'X-Api-Key';
/** @var ApiKeyServiceInterface */
private $apiKeyService;
private ApiKeyServiceInterface $apiKeyService;
public function __construct(ApiKeyServiceInterface $apiKeyService)
{

View File

@ -20,8 +20,7 @@ class RequestToHttpAuthPlugin implements RequestToHttpAuthPluginInterface
Plugin\AuthorizationHeaderPlugin::HEADER_NAME,
];
/** @var AuthenticationPluginManagerInterface */
private $authPluginManager;
private AuthenticationPluginManagerInterface $authPluginManager;
public function __construct(AuthenticationPluginManagerInterface $authPluginManager)
{

View File

@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Rest;
use Closure;
use function Shlinkio\Shlink\Common\loadConfigFromGlob;
use function sprintf;
@ -11,14 +13,11 @@ class ConfigProvider
{
private const ROUTES_PREFIX = '/rest/v{version:1|2}';
/** @var callable */
private $loadConfig;
private Closure $loadConfig;
public function __construct(?callable $loadConfig = null)
{
$this->loadConfig = $loadConfig ?? function (string $glob) {
return loadConfigFromGlob($glob);
};
$this->loadConfig = Closure::fromCallable($loadConfig ?? fn (string $glob) => loadConfigFromGlob($glob));
}
public function __invoke()

View File

@ -12,12 +12,9 @@ class ApiKey extends AbstractEntity
{
use StringUtilsTrait;
/** @var string */
private $key;
/** @var Chronos|null */
private $expirationDate;
/** @var bool */
private $enabled;
private string $key;
private ?Chronos $expirationDate;
private bool $enabled;
public function __construct(?Chronos $expirationDate = null)
{

View File

@ -17,10 +17,8 @@ use function Functional\contains;
class AuthenticationMiddleware implements MiddlewareInterface, StatusCodeInterface, RequestMethodInterface
{
/** @var array */
private $routesWhitelist;
/** @var RequestToHttpAuthPluginInterface */
private $requestToAuthPlugin;
private array $routesWhitelist;
private RequestToHttpAuthPluginInterface $requestToAuthPlugin;
public function __construct(RequestToHttpAuthPluginInterface $requestToAuthPlugin, array $routesWhitelist)
{

View File

@ -22,10 +22,8 @@ class BackwardsCompatibleProblemDetailsMiddleware implements MiddlewareInterface
'message' => 'detail',
];
/** @var array */
private $defaultTypeFallbacks;
/** @var int */
private $jsonFlags;
private array $defaultTypeFallbacks;
private int $jsonFlags;
public function __construct(array $defaultTypeFallbacks, int $jsonFlags)
{

View File

@ -13,8 +13,7 @@ use function sprintf;
class ApiKeyService implements ApiKeyServiceInterface
{
/** @var EntityManagerInterface */
private $em;
private EntityManagerInterface $em;
public function __construct(EntityManagerInterface $em)
{

View File

@ -15,6 +15,7 @@ use Zend\Diactoros\ServerRequest;
use function strpos;
/** @deprecated */
class AuthenticateActionTest extends TestCase
{
/** @var AuthenticateAction */

View File

@ -15,10 +15,8 @@ use Zend\Diactoros\ServerRequest;
class HealthActionTest extends TestCase
{
/** @var HealthAction */
private $action;
/** @var ObjectProphecy */
private $conn;
private HealthAction $action;
private ObjectProphecy $conn;
public function setUp(): void
{

View File

@ -26,10 +26,8 @@ class CreateShortUrlActionTest extends TestCase
'hostname' => 'foo.com',
];
/** @var CreateShortUrlAction */
private $action;
/** @var ObjectProphecy */
private $urlShortener;
private CreateShortUrlAction $action;
private ObjectProphecy $urlShortener;
public function setUp(): void
{

View File

@ -13,10 +13,8 @@ use Zend\Diactoros\ServerRequest;
class DeleteShortUrlActionTest extends TestCase
{
/** @var DeleteShortUrlAction */
private $action;
/** @var ObjectProphecy */
private $service;
private DeleteShortUrlAction $action;
private ObjectProphecy $service;
public function setUp(): void
{

View File

@ -15,10 +15,8 @@ use Zend\Diactoros\ServerRequest;
class EditShortUrlActionTest extends TestCase
{
/** @var EditShortUrlAction */
private $action;
/** @var ObjectProphecy */
private $shortUrlService;
private EditShortUrlAction $action;
private ObjectProphecy $shortUrlService;
public function setUp(): void
{

View File

@ -14,10 +14,8 @@ use Zend\Diactoros\ServerRequest;
class EditShortUrlTagsActionTest extends TestCase
{
/** @var EditShortUrlTagsAction */
private $action;
/** @var ObjectProphecy */
private $shortUrlService;
private EditShortUrlTagsAction $action;
private ObjectProphecy $shortUrlService;
public function setUp(): void
{

View File

@ -18,12 +18,9 @@ use Zend\Paginator\Paginator;
class ListShortUrlsActionTest extends TestCase
{
/** @var ListShortUrlsAction */
private $action;
/** @var ObjectProphecy */
private $service;
/** @var ObjectProphecy */
private $logger;
private ListShortUrlsAction $action;
private ObjectProphecy $service;
private ObjectProphecy $logger;
public function setUp(): void
{

View File

@ -15,10 +15,8 @@ use function strpos;
class ResolveShortUrlActionTest extends TestCase
{
/** @var ResolveShortUrlAction */
private $action;
/** @var ObjectProphecy */
private $urlShortener;
private ResolveShortUrlAction $action;
private ObjectProphecy $urlShortener;
public function setUp(): void
{

View File

@ -19,12 +19,9 @@ use Zend\Diactoros\ServerRequest;
class SingleStepCreateShortUrlActionTest extends TestCase
{
/** @var SingleStepCreateShortUrlAction */
private $action;
/** @var ObjectProphecy */
private $urlShortener;
/** @var ObjectProphecy */
private $apiKeyService;
private SingleStepCreateShortUrlAction $action;
private ObjectProphecy $urlShortener;
private ObjectProphecy $apiKeyService;
public function setUp(): void
{

View File

@ -13,10 +13,8 @@ use Zend\Diactoros\ServerRequest;
class CreateTagsActionTest extends TestCase
{
/** @var CreateTagsAction */
private $action;
/** @var ObjectProphecy */
private $tagService;
private CreateTagsAction $action;
private ObjectProphecy $tagService;
public function setUp(): void
{

View File

@ -12,10 +12,8 @@ use Zend\Diactoros\ServerRequest;
class DeleteTagsActionTest extends TestCase
{
/** @var DeleteTagsAction */
private $action;
/** @var ObjectProphecy */
private $tagService;
private DeleteTagsAction $action;
private ObjectProphecy $tagService;
public function setUp(): void
{

View File

@ -15,10 +15,8 @@ use function Shlinkio\Shlink\Common\json_decode;
class ListTagsActionTest extends TestCase
{
/** @var ListTagsAction */
private $action;
/** @var ObjectProphecy */
private $tagService;
private ListTagsAction $action;
private ObjectProphecy $tagService;
public function setUp(): void
{

View File

@ -14,10 +14,8 @@ use Zend\Diactoros\ServerRequest;
class UpdateTagActionTest extends TestCase
{
/** @var UpdateTagAction */
private $action;
/** @var ObjectProphecy */
private $tagService;
private UpdateTagAction $action;
private ObjectProphecy $tagService;
public function setUp(): void
{

View File

@ -18,10 +18,8 @@ use Zend\Paginator\Paginator;
class GetVisitsActionTest extends TestCase
{
/** @var GetVisitsAction */
private $action;
/** @var ObjectProphecy */
private $visitsTracker;
private GetVisitsAction $action;
private ObjectProphecy $visitsTracker;
public function setUp(): void
{

View File

@ -12,8 +12,7 @@ use Zend\ServiceManager\ServiceManager;
class AuthenticationPluginManagerFactoryTest extends TestCase
{
/** @var AuthenticationPluginManagerFactory */
private $factory;
private AuthenticationPluginManagerFactory $factory;
public function setUp(): void
{

View File

@ -13,6 +13,7 @@ use Shlinkio\Shlink\Rest\Exception\AuthenticationException;
use function time;
/** @deprecated */
class JWTServiceTest extends TestCase
{
/** @var JWTService */

View File

@ -15,10 +15,8 @@ use Zend\Diactoros\ServerRequest;
class ApiKeyHeaderPluginTest extends TestCase
{
/** @var ApiKeyHeaderPlugin */
private $plugin;
/** @var ObjectProphecy */
private $apiKeyService;
private ApiKeyHeaderPlugin $plugin;
private ObjectProphecy $apiKeyService;
public function setUp(): void
{

View File

@ -14,6 +14,7 @@ use Zend\Diactoros\ServerRequest;
use function sprintf;
/** @deprecated */
class AuthorizationHeaderPluginTest extends TestCase
{
/** @var AuthorizationHeaderPlugin */

View File

@ -19,10 +19,8 @@ use function sprintf;
class RequestToAuthPluginTest extends TestCase
{
/** @var RequestToHttpAuthPlugin */
private $requestToPlugin;
/** @var ObjectProphecy */
private $pluginManager;
private RequestToHttpAuthPlugin $requestToPlugin;
private ObjectProphecy $pluginManager;
public function setUp(): void
{

View File

@ -9,8 +9,7 @@ use Shlinkio\Shlink\Rest\ConfigProvider;
class ConfigProviderTest extends TestCase
{
/** @var ConfigProvider */
private $configProvider;
private ConfigProvider $configProvider;
public function setUp(): void
{

View File

@ -28,12 +28,9 @@ use function Functional\contains;
class NotifyVisitToWebHooksTest extends TestCase
{
/** @var ObjectProphecy */
private $httpClient;
/** @var ObjectProphecy */
private $em;
/** @var ObjectProphecy */
private $logger;
private ObjectProphecy $httpClient;
private ObjectProphecy $em;
private ObjectProphecy $logger;
public function setUp(): void
{

View File

@ -26,12 +26,9 @@ use function Zend\Stratigility\middleware;
class AuthenticationMiddlewareTest extends TestCase
{
/** @var AuthenticationMiddleware */
private $middleware;
/** @var ObjectProphecy */
private $requestToPlugin;
/** @var ObjectProphecy */
private $logger;
private AuthenticationMiddleware $middleware;
private ObjectProphecy $requestToPlugin;
private ObjectProphecy $logger;
public function setUp(): void
{

View File

@ -14,10 +14,8 @@ use Zend\Diactoros\Uri;
class BackwardsCompatibleProblemDetailsMiddlewareTest extends TestCase
{
/** @var BackwardsCompatibleProblemDetailsMiddleware */
private $middleware;
/** @var ObjectProphecy */
private $handler;
private BackwardsCompatibleProblemDetailsMiddleware $middleware;
private ObjectProphecy $handler;
public function setUp(): void
{

View File

@ -18,8 +18,7 @@ use function array_shift;
class BodyParserMiddlewareTest extends TestCase
{
/** @var BodyParserMiddleware */
private $middleware;
private BodyParserMiddleware $middleware;
public function setUp(): void
{

View File

@ -20,10 +20,8 @@ use function Zend\Stratigility\middleware;
class CrossDomainMiddlewareTest extends TestCase
{
/** @var CrossDomainMiddleware */
private $middleware;
/** @var ObjectProphecy */
private $handler;
private CrossDomainMiddleware $middleware;
private ObjectProphecy $handler;
public function setUp(): void
{

View File

@ -12,8 +12,7 @@ use Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware;
class EmptyResponseImplicitOptionsMiddlewareFactoryTest extends TestCase
{
/** @var EmptyResponseImplicitOptionsMiddlewareFactory */
private $factory;
private EmptyResponseImplicitOptionsMiddlewareFactory $factory;
public function setUp(): void
{

View File

@ -18,8 +18,7 @@ use function array_shift;
class PathVersionMiddlewareTest extends TestCase
{
/** @var PathVersionMiddleware */
private $middleware;
private PathVersionMiddleware $middleware;
public function setUp(): void
{
@ -27,7 +26,7 @@ class PathVersionMiddlewareTest extends TestCase
}
/** @test */
public function whenVersionIsProvidedRequestRemainsUnchanged()
public function whenVersionIsProvidedRequestRemainsUnchanged(): void
{
$request = (new ServerRequest())->withUri(new Uri('/v2/foo'));
@ -40,7 +39,7 @@ class PathVersionMiddlewareTest extends TestCase
}
/** @test */
public function versionOneIsPrependedWhenNoVersionIsDefined()
public function versionOneIsPrependedWhenNoVersionIsDefined(): void
{
$request = (new ServerRequest())->withUri(new Uri('/bar/baz'));

View File

@ -6,6 +6,7 @@ namespace ShlinkioTest\Shlink\Rest\Middleware\ShortUrl;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Shlinkio\Shlink\Rest\Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware;
@ -15,10 +16,8 @@ use Zend\Diactoros\ServerRequest;
class CreateShortUrlContentNegotiationMiddlewareTest extends TestCase
{
/** @var CreateShortUrlContentNegotiationMiddleware */
private $middleware;
/** @var RequestHandlerInterface */
private $requestHandler;
private CreateShortUrlContentNegotiationMiddleware $middleware;
private ObjectProphecy $requestHandler;
public function setUp(): void
{