Enforced property types comments in one line

This commit is contained in:
Alejandro Celaya
2018-11-20 19:30:27 +01:00
parent 15a70d0157
commit 0ae5a53d86
161 changed files with 303 additions and 903 deletions

View File

@@ -16,9 +16,7 @@ class DisableKeyCommand extends Command
{ {
public const NAME = 'api-key:disable'; public const NAME = 'api-key:disable';
/** /** @var ApiKeyServiceInterface */
* @var ApiKeyServiceInterface
*/
private $apiKeyService; private $apiKeyService;
public function __construct(ApiKeyServiceInterface $apiKeyService) public function __construct(ApiKeyServiceInterface $apiKeyService)

View File

@@ -16,9 +16,7 @@ class GenerateKeyCommand extends Command
{ {
public const NAME = 'api-key:generate'; public const NAME = 'api-key:generate';
/** /** @var ApiKeyServiceInterface */
* @var ApiKeyServiceInterface
*/
private $apiKeyService; private $apiKeyService;
public function __construct(ApiKeyServiceInterface $apiKeyService) public function __construct(ApiKeyServiceInterface $apiKeyService)

View File

@@ -22,9 +22,7 @@ class ListKeysCommand extends Command
public const NAME = 'api-key:list'; public const NAME = 'api-key:list';
/** /** @var ApiKeyServiceInterface */
* @var ApiKeyServiceInterface
*/
private $apiKeyService; private $apiKeyService;
public function __construct(ApiKeyServiceInterface $apiKeyService) public function __construct(ApiKeyServiceInterface $apiKeyService)

View File

@@ -18,9 +18,7 @@ class DeleteShortUrlCommand extends Command
public const NAME = 'short-url:delete'; public const NAME = 'short-url:delete';
private const ALIASES = ['short-code:delete']; private const ALIASES = ['short-code:delete'];
/** /** @var DeleteShortUrlServiceInterface */
* @var DeleteShortUrlServiceInterface
*/
private $deleteShortUrlService; private $deleteShortUrlService;
public function __construct(DeleteShortUrlServiceInterface $deleteShortUrlService) public function __construct(DeleteShortUrlServiceInterface $deleteShortUrlService)

View File

@@ -17,13 +17,9 @@ class GeneratePreviewCommand extends Command
public const NAME = 'short-url:process-previews'; public const NAME = 'short-url:process-previews';
private const ALIASES = ['shortcode:process-previews', 'short-code:process-previews']; private const ALIASES = ['shortcode:process-previews', 'short-code:process-previews'];
/** /** @var PreviewGeneratorInterface */
* @var PreviewGeneratorInterface
*/
private $previewGenerator; private $previewGenerator;
/** /** @var ShortUrlServiceInterface */
* @var ShortUrlServiceInterface
*/
private $shortUrlService; private $shortUrlService;
public function __construct(ShortUrlServiceInterface $shortUrlService, PreviewGeneratorInterface $previewGenerator) public function __construct(ShortUrlServiceInterface $shortUrlService, PreviewGeneratorInterface $previewGenerator)

View File

@@ -26,13 +26,9 @@ class GenerateShortUrlCommand extends Command
public const NAME = 'short-url:generate'; public const NAME = 'short-url:generate';
private const ALIASES = ['shortcode:generate', 'short-code:generate']; private const ALIASES = ['shortcode:generate', 'short-code:generate'];
/** /** @var UrlShortenerInterface */
* @var UrlShortenerInterface
*/
private $urlShortener; private $urlShortener;
/** /** @var array */
* @var array
*/
private $domainConfig; private $domainConfig;
public function __construct(UrlShortenerInterface $urlShortener, array $domainConfig) public function __construct(UrlShortenerInterface $urlShortener, array $domainConfig)

View File

@@ -21,9 +21,7 @@ class GetVisitsCommand extends Command
public const NAME = 'short-url:visits'; public const NAME = 'short-url:visits';
private const ALIASES = ['shortcode:visits', 'short-code:visits']; private const ALIASES = ['shortcode:visits', 'short-code:visits'];
/** /** @var VisitsTrackerInterface */
* @var VisitsTrackerInterface
*/
private $visitsTracker; private $visitsTracker;
public function __construct(VisitsTrackerInterface $visitsTracker) public function __construct(VisitsTrackerInterface $visitsTracker)

View File

@@ -25,13 +25,9 @@ class ListShortUrlsCommand extends Command
public const NAME = 'short-url:list'; public const NAME = 'short-url:list';
private const ALIASES = ['shortcode:list', 'short-code:list']; private const ALIASES = ['shortcode:list', 'short-code:list'];
/** /** @var ShortUrlServiceInterface */
* @var ShortUrlServiceInterface
*/
private $shortUrlService; private $shortUrlService;
/** /** @var array */
* @var array
*/
private $domainConfig; private $domainConfig;
public function __construct(ShortUrlServiceInterface $shortUrlService, array $domainConfig) public function __construct(ShortUrlServiceInterface $shortUrlService, array $domainConfig)

View File

@@ -18,9 +18,7 @@ class ResolveUrlCommand extends Command
public const NAME = 'short-url:parse'; public const NAME = 'short-url:parse';
private const ALIASES = ['shortcode:parse', 'short-code:parse']; private const ALIASES = ['shortcode:parse', 'short-code:parse'];
/** /** @var UrlShortenerInterface */
* @var UrlShortenerInterface
*/
private $urlShortener; private $urlShortener;
public function __construct(UrlShortenerInterface $urlShortener) public function __construct(UrlShortenerInterface $urlShortener)

View File

@@ -14,9 +14,7 @@ class CreateTagCommand extends Command
{ {
public const NAME = 'tag:create'; public const NAME = 'tag:create';
/** /** @var TagServiceInterface */
* @var TagServiceInterface
*/
private $tagService; private $tagService;
public function __construct(TagServiceInterface $tagService) public function __construct(TagServiceInterface $tagService)

View File

@@ -14,9 +14,7 @@ class DeleteTagsCommand extends Command
{ {
public const NAME = 'tag:delete'; public const NAME = 'tag:delete';
/** /** @var TagServiceInterface */
* @var TagServiceInterface
*/
private $tagService; private $tagService;
public function __construct(TagServiceInterface $tagService) public function __construct(TagServiceInterface $tagService)

View File

@@ -15,9 +15,7 @@ class ListTagsCommand extends Command
{ {
public const NAME = 'tag:list'; public const NAME = 'tag:list';
/** /** @var TagServiceInterface */
* @var TagServiceInterface
*/
private $tagService; private $tagService;
public function __construct(TagServiceInterface $tagService) public function __construct(TagServiceInterface $tagService)

View File

@@ -16,9 +16,7 @@ class RenameTagCommand extends Command
{ {
public const NAME = 'tag:rename'; public const NAME = 'tag:rename';
/** /** @var TagServiceInterface */
* @var TagServiceInterface
*/
private $tagService; private $tagService;
public function __construct(TagServiceInterface $tagService) public function __construct(TagServiceInterface $tagService)

View File

@@ -21,21 +21,13 @@ class ProcessVisitsCommand extends Command
{ {
public const NAME = 'visit:process'; public const NAME = 'visit:process';
/** /** @var VisitServiceInterface */
* @var VisitServiceInterface
*/
private $visitService; private $visitService;
/** /** @var IpLocationResolverInterface */
* @var IpLocationResolverInterface
*/
private $ipLocationResolver; private $ipLocationResolver;
/** /** @var Locker */
* @var Locker
*/
private $locker; private $locker;
/** /** @var OutputInterface */
* @var OutputInterface
*/
private $output; private $output;
public function __construct( public function __construct(

View File

@@ -15,9 +15,7 @@ class UpdateDbCommand extends Command
{ {
public const NAME = 'visit:update-db'; public const NAME = 'visit:update-db';
/** /** @var DbUpdaterInterface */
* @var DbUpdaterInterface
*/
private $geoLiteDbUpdater; private $geoLiteDbUpdater;
public function __construct(DbUpdaterInterface $geoLiteDbUpdater) public function __construct(DbUpdaterInterface $geoLiteDbUpdater)

View File

@@ -13,13 +13,9 @@ use Symfony\Component\Console\Tester\CommandTester;
class DisableKeyCommandTest extends TestCase class DisableKeyCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $apiKeyService; protected $apiKeyService;
public function setUp() public function setUp()

View File

@@ -15,13 +15,9 @@ use Symfony\Component\Console\Tester\CommandTester;
class GenerateKeyCommandTest extends TestCase class GenerateKeyCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $apiKeyService; protected $apiKeyService;
public function setUp() public function setUp()

View File

@@ -13,13 +13,9 @@ use Symfony\Component\Console\Tester\CommandTester;
class ListKeysCommandTest extends TestCase class ListKeysCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $apiKeyService; protected $apiKeyService;
public function setUp() public function setUp()

View File

@@ -13,9 +13,7 @@ use function str_split;
class GenerateCharsetCommandTest extends TestCase class GenerateCharsetCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
public function setUp() public function setUp()

View File

@@ -16,13 +16,9 @@ use function sprintf;
class DeleteShortCodeCommandTest extends TestCase class DeleteShortCodeCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
private $commandTester; private $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $service; private $service;
public function setUp() public function setUp()

View File

@@ -20,17 +20,11 @@ use function substr_count;
class GeneratePreviewCommandTest extends TestCase class GeneratePreviewCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $previewGenerator; private $previewGenerator;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $shortUrlService; private $shortUrlService;
public function setUp() public function setUp()

View File

@@ -17,13 +17,9 @@ use Symfony\Component\Console\Tester\CommandTester;
class GenerateShortUrlCommandTest extends TestCase class GenerateShortUrlCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $urlShortener; protected $urlShortener;
public function setUp() public function setUp()

View File

@@ -20,13 +20,9 @@ use function strpos;
class GetVisitsCommandTest extends TestCase class GetVisitsCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $visitsTracker; protected $visitsTracker;
public function setUp() public function setUp()

View File

@@ -16,13 +16,9 @@ use Zend\Paginator\Paginator;
class ListShortUrlsCommandTest extends TestCase class ListShortUrlsCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $shortUrlService; protected $shortUrlService;
public function setUp() public function setUp()

View File

@@ -16,13 +16,9 @@ use const PHP_EOL;
class ResolveUrlCommandTest extends TestCase class ResolveUrlCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
protected $commandTester; protected $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $urlShortener; protected $urlShortener;
public function setUp() public function setUp()

View File

@@ -14,13 +14,9 @@ use Symfony\Component\Console\Tester\CommandTester;
class CreateTagCommandTest extends TestCase class CreateTagCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
private $commandTester; private $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $tagService; private $tagService;
public function setUp() public function setUp()

View File

@@ -13,17 +13,11 @@ use Symfony\Component\Console\Tester\CommandTester;
class DeleteTagsCommandTest extends TestCase class DeleteTagsCommandTest extends TestCase
{ {
/** /** @var DeleteTagsCommand */
* @var DeleteTagsCommand
*/
private $command; private $command;
/** /** @var CommandTester */
* @var CommandTester
*/
private $commandTester; private $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $tagService; private $tagService;
public function setUp() public function setUp()

View File

@@ -14,17 +14,11 @@ use Symfony\Component\Console\Tester\CommandTester;
class ListTagsCommandTest extends TestCase class ListTagsCommandTest extends TestCase
{ {
/** /** @var ListTagsCommand */
* @var ListTagsCommand
*/
private $command; private $command;
/** /** @var CommandTester */
* @var CommandTester
*/
private $commandTester; private $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $tagService; private $tagService;
public function setUp() public function setUp()

View File

@@ -15,17 +15,11 @@ use Symfony\Component\Console\Tester\CommandTester;
class RenameTagCommandTest extends TestCase class RenameTagCommandTest extends TestCase
{ {
/** /** @var RenameTagCommand */
* @var RenameTagCommand
*/
private $command; private $command;
/** /** @var CommandTester */
* @var CommandTester
*/
private $commandTester; private $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $tagService; private $tagService;
public function setUp() public function setUp()

View File

@@ -26,25 +26,15 @@ use function sprintf;
class ProcessVisitsCommandTest extends TestCase class ProcessVisitsCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
private $commandTester; private $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $visitService; private $visitService;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $ipResolver; private $ipResolver;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $locker; private $locker;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $lock; private $lock;
public function setUp() public function setUp()

View File

@@ -14,13 +14,9 @@ use Symfony\Component\Console\Tester\CommandTester;
class UpdateDbCommandTest extends TestCase class UpdateDbCommandTest extends TestCase
{ {
/** /** @var CommandTester */
* @var CommandTester
*/
private $commandTester; private $commandTester;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $dbUpdater; private $dbUpdater;
public function setUp() public function setUp()

View File

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

View File

@@ -15,9 +15,7 @@ use function array_merge;
class ApplicationFactoryTest extends TestCase class ApplicationFactoryTest extends TestCase
{ {
/** /** @var ApplicationFactory */
* @var ApplicationFactory
*/
protected $factory; protected $factory;
public function setUp() public function setUp()

View File

@@ -9,9 +9,7 @@ use function is_array;
final class PathCollection final class PathCollection
{ {
/** /** @var array */
* @var array
*/
private $array; private $array;
public function __construct(array $array) public function __construct(array $array)

View File

@@ -7,9 +7,7 @@ use Shlinkio\Shlink\Common\Exception\WrongIpException;
class ChainIpLocationResolver implements IpLocationResolverInterface class ChainIpLocationResolver implements IpLocationResolverInterface
{ {
/** /** @var IpLocationResolverInterface[] */
* @var IpLocationResolverInterface[]
*/
private $resolvers; private $resolvers;
public function __construct(IpLocationResolverInterface ...$resolvers) public function __construct(IpLocationResolverInterface ...$resolvers)

View File

@@ -19,17 +19,11 @@ class DbUpdater implements DbUpdaterInterface
private const DB_COMPRESSED_FILE = 'GeoLite2-City.tar.gz'; private const DB_COMPRESSED_FILE = 'GeoLite2-City.tar.gz';
private const DB_DECOMPRESSED_FILE = 'GeoLite2-City.mmdb'; private const DB_DECOMPRESSED_FILE = 'GeoLite2-City.mmdb';
/** /** @var ClientInterface */
* @var ClientInterface
*/
private $httpClient; private $httpClient;
/** /** @var Filesystem */
* @var Filesystem
*/
private $filesystem; private $filesystem;
/** /** @var GeoLite2Options */
* @var GeoLite2Options
*/
private $options; private $options;
public function __construct(ClientInterface $httpClient, Filesystem $filesystem, GeoLite2Options $options) public function __construct(ClientInterface $httpClient, Filesystem $filesystem, GeoLite2Options $options)

View File

@@ -13,9 +13,7 @@ use function Functional\first;
class GeoLite2LocationResolver implements IpLocationResolverInterface class GeoLite2LocationResolver implements IpLocationResolverInterface
{ {
/** /** @var Reader */
* @var Reader
*/
private $geoLiteDbReader; private $geoLiteDbReader;
public function __construct(Reader $geoLiteDbReader) public function __construct(Reader $geoLiteDbReader)

View File

@@ -14,9 +14,7 @@ class IpApiLocationResolver implements IpLocationResolverInterface
{ {
private const SERVICE_PATTERN = 'http://ip-api.com/json/%s'; private const SERVICE_PATTERN = 'http://ip-api.com/json/%s';
/** /** @var Client */
* @var Client
*/
private $httpClient; private $httpClient;
public function __construct(Client $httpClient) public function __construct(Client $httpClient)

View File

@@ -15,9 +15,7 @@ class LocaleMiddleware implements MiddlewareInterface
{ {
private const ACCEPT_LANGUAGE = 'Accept-Language'; private const ACCEPT_LANGUAGE = 'Accept-Language';
/** /** @var Translator */
* @var Translator
*/
private $translator; private $translator;
public function __construct(Translator $translator) public function __construct(Translator $translator)

View File

@@ -12,21 +12,13 @@ class PaginableRepositoryAdapter implements AdapterInterface
{ {
public const ITEMS_PER_PAGE = 10; public const ITEMS_PER_PAGE = 10;
/** /** @var PaginableRepositoryInterface */
* @var PaginableRepositoryInterface
*/
private $paginableRepository; private $paginableRepository;
/** /** @var null|string */
* @var null|string
*/
private $searchTerm; private $searchTerm;
/** /** @var null|array|string */
* @var null|array|string
*/
private $orderBy; private $orderBy;
/** /** @var array */
* @var array
*/
private $tags; private $tags;
public function __construct( public function __construct(

View File

@@ -12,17 +12,11 @@ use function urlencode;
class PreviewGenerator implements PreviewGeneratorInterface class PreviewGenerator implements PreviewGeneratorInterface
{ {
/** /** @var string */
* @var string
*/
private $location; private $location;
/** /** @var ImageBuilderInterface */
* @var ImageBuilderInterface
*/
private $imageBuilder; private $imageBuilder;
/** /** @var Filesystem */
* @var Filesystem
*/
private $filesystem; private $filesystem;
public function __construct(ImageBuilderInterface $imageBuilder, Filesystem $filesystem, $location) public function __construct(ImageBuilderInterface $imageBuilder, Filesystem $filesystem, $location)

View File

@@ -9,9 +9,7 @@ use Zend\I18n\Translator\TranslatorInterface;
class TranslatorExtension implements ExtensionInterface class TranslatorExtension implements ExtensionInterface
{ {
/** /** @var TranslatorInterface */
* @var TranslatorInterface
*/
private $translator; private $translator;
public function __construct(TranslatorInterface $translator) public function __construct(TranslatorInterface $translator)

View File

@@ -7,13 +7,9 @@ use Cake\Chronos\Chronos;
final class DateRange final class DateRange
{ {
/** /** @var Chronos|null */
* @var Chronos|null
*/
private $startDate; private $startDate;
/** /** @var Chronos|null */
* @var Chronos|null
*/
private $endDate; private $endDate;
public function __construct(?Chronos $startDate = null, ?Chronos $endDate = null) public function __construct(?Chronos $startDate = null, ?Chronos $endDate = null)

View File

@@ -15,21 +15,13 @@ final class IpAddress
private const OBFUSCATED_OCTET = '0'; private const OBFUSCATED_OCTET = '0';
public const LOCALHOST = '127.0.0.1'; public const LOCALHOST = '127.0.0.1';
/** /** @var string */
* @var string
*/
private $firstOctet; private $firstOctet;
/** /** @var string */
* @var string
*/
private $secondOctet; private $secondOctet;
/** /** @var string */
* @var string
*/
private $thirdOctet; private $thirdOctet;
/** /** @var string */
* @var string
*/
private $fourthOctet; private $fourthOctet;
private function __construct(string $firstOctet, string $secondOctet, string $thirdOctet, string $fourthOctet) private function __construct(string $firstOctet, string $secondOctet, string $thirdOctet, string $fourthOctet)

View File

@@ -10,9 +10,7 @@ abstract class DatabaseTestCase extends TestCase
{ {
protected const ENTITIES_TO_EMPTY = []; protected const ENTITIES_TO_EMPTY = [];
/** /** @var EntityManagerInterface */
* @var EntityManagerInterface
*/
public static $em; public static $em;
protected function getEntityManager(): EntityManagerInterface protected function getEntityManager(): EntityManagerInterface

View File

@@ -8,9 +8,7 @@ use Shlinkio\Shlink\Common\Collection\PathCollection;
class PathCollectionTest extends TestCase class PathCollectionTest extends TestCase
{ {
/** /** @var PathCollection */
* @var PathCollection
*/
private $collection; private $collection;
public function setUp() public function setUp()

View File

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

View File

@@ -19,9 +19,7 @@ use function sys_get_temp_dir;
class CacheFactoryTest extends TestCase class CacheFactoryTest extends TestCase
{ {
/** /** @var CacheFactory */
* @var CacheFactory
*/
protected $factory; protected $factory;
public function setUp() public function setUp()

View File

@@ -11,9 +11,7 @@ use Zend\ServiceManager\ServiceManager;
class DottedAccessConfigAbstractFactoryTest extends TestCase class DottedAccessConfigAbstractFactoryTest extends TestCase
{ {
/** /** @var DottedAccessConfigAbstractFactory */
* @var DottedAccessConfigAbstractFactory
*/
private $factory; private $factory;
public function setUp() public function setUp()

View File

@@ -12,9 +12,7 @@ use Zend\ServiceManager\ServiceManager;
class EmptyResponseImplicitOptionsMiddlewareFactoryTest extends TestCase class EmptyResponseImplicitOptionsMiddlewareFactoryTest extends TestCase
{ {
/** /** @var EmptyResponseImplicitOptionsMiddlewareFactory */
* @var EmptyResponseImplicitOptionsMiddlewareFactory
*/
protected $factory; protected $factory;
public function setUp() public function setUp()

View File

@@ -10,9 +10,7 @@ use Zend\ServiceManager\ServiceManager;
class EntityManagerFactoryTest extends TestCase class EntityManagerFactoryTest extends TestCase
{ {
/** /** @var EntityManagerFactory */
* @var EntityManagerFactory
*/
protected $factory; protected $factory;
public function setUp() public function setUp()

View File

@@ -11,9 +11,7 @@ use Zend\ServiceManager\ServiceManager;
class LoggerFactoryTest extends TestCase class LoggerFactoryTest extends TestCase
{ {
/** /** @var LoggerFactory */
* @var LoggerFactory
*/
protected $factory; protected $factory;
public function setUp() public function setUp()

View File

@@ -10,9 +10,7 @@ use Zend\ServiceManager\ServiceManager;
class TranslatorFactoryTest extends TestCase class TranslatorFactoryTest extends TestCase
{ {
/** /** @var TranslatorFactory */
* @var TranslatorFactory
*/
protected $factory; protected $factory;
public function setUp() public function setUp()

View File

@@ -10,9 +10,7 @@ use Zend\ServiceManager\ServiceManager;
class ImageBuilderFactoryTest extends TestCase class ImageBuilderFactoryTest extends TestCase
{ {
/** /** @var ImageBuilderFactory */
* @var ImageBuilderFactory
*/
protected $factory; protected $factory;
public function setUp() public function setUp()

View File

@@ -11,9 +11,7 @@ use Zend\ServiceManager\ServiceManager;
class ImageFactoryTest extends TestCase class ImageFactoryTest extends TestCase
{ {
/** /** @var ImageFactory */
* @var ImageFactory
*/
protected $factory; protected $factory;
public function setUp() public function setUp()

View File

@@ -11,17 +11,11 @@ use Shlinkio\Shlink\Common\IpGeolocation\IpLocationResolverInterface;
class ChainIpLocationResolverTest extends TestCase class ChainIpLocationResolverTest extends TestCase
{ {
/** /** @var ChainIpLocationResolver */
* @var ChainIpLocationResolver
*/
private $resolver; private $resolver;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $firstInnerResolver; private $firstInnerResolver;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $secondInnerResolver; private $secondInnerResolver;
public function setUp() public function setUp()

View File

@@ -23,9 +23,7 @@ class EmptyIpLocationResolverTest extends TestCase
'time_zone' => '', 'time_zone' => '',
]; ];
/** /** @var EmptyIpLocationResolver */
* @var EmptyIpLocationResolver
*/
private $resolver; private $resolver;
public function setUp() public function setUp()

View File

@@ -17,21 +17,13 @@ use Zend\Diactoros\Response;
class DbUpdaterTest extends TestCase class DbUpdaterTest extends TestCase
{ {
/** /** @var DbUpdater */
* @var DbUpdater
*/
private $dbUpdater; private $dbUpdater;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $httpClient; private $httpClient;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $filesystem; private $filesystem;
/** /** @var GeoLite2Options */
* @var GeoLite2Options
*/
private $options; private $options;
public function setUp() public function setUp()

View File

@@ -14,13 +14,9 @@ use Shlinkio\Shlink\Common\IpGeolocation\GeoLite2LocationResolver;
class GeoLite2LocationResolverTest extends TestCase class GeoLite2LocationResolverTest extends TestCase
{ {
/** /** @var GeoLite2LocationResolver */
* @var GeoLite2LocationResolver
*/
private $resolver; private $resolver;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $reader; private $reader;
public function setUp() public function setUp()

View File

@@ -13,13 +13,9 @@ use function json_encode;
class IpApiLocationResolverTest extends TestCase class IpApiLocationResolverTest extends TestCase
{ {
/** /** @var IpApiLocationResolver */
* @var IpApiLocationResolver
*/
protected $ipResolver; protected $ipResolver;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $client; protected $client;
public function setUp() public function setUp()

View File

@@ -9,9 +9,7 @@ use const PHP_EOL;
class ExceptionWithNewLineProcessorTest extends TestCase class ExceptionWithNewLineProcessorTest extends TestCase
{ {
/** /** @var ExceptionWithNewLineProcessor */
* @var ExceptionWithNewLineProcessor
*/
private $processor; private $processor;
public function setUp() public function setUp()

View File

@@ -11,13 +11,9 @@ use Zend\I18n\Translator\Translator;
class LocaleMiddlewareTest extends TestCase class LocaleMiddlewareTest extends TestCase
{ {
/** /** @var LocaleMiddleware */
* @var LocaleMiddleware
*/
protected $middleware; protected $middleware;
/** /** @var Translator */
* @var Translator
*/
protected $translator; protected $translator;
public function setUp() public function setUp()

View File

@@ -10,13 +10,9 @@ use Shlinkio\Shlink\Common\Repository\PaginableRepositoryInterface;
class PaginableRepositoryAdapterTest extends TestCase class PaginableRepositoryAdapterTest extends TestCase
{ {
/** /** @var PaginableRepositoryAdapter */
* @var PaginableRepositoryAdapter
*/
protected $adapter; protected $adapter;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $repo; protected $repo;
public function setUp() public function setUp()

View File

@@ -8,9 +8,7 @@ use Shlinkio\Shlink\Common\Response\PixelResponse;
class PixelResponseTest extends TestCase class PixelResponseTest extends TestCase
{ {
/** /** @var PixelResponse */
* @var PixelResponse
*/
private $resp; private $resp;
public function setUp() public function setUp()

View File

@@ -16,17 +16,11 @@ use function urlencode;
class PreviewGeneratorTest extends TestCase class PreviewGeneratorTest extends TestCase
{ {
/** /** @var PreviewGenerator */
* @var PreviewGenerator
*/
protected $generator; protected $generator;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $image; protected $image;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $filesystem; protected $filesystem;
public function setUp() public function setUp()

View File

@@ -11,9 +11,7 @@ use Zend\I18n\Translator\Translator;
class TranslatorExtensionTest extends TestCase class TranslatorExtensionTest extends TestCase
{ {
/** /** @var TranslatorExtension */
* @var TranslatorExtension
*/
protected $extension; protected $extension;
public function setUp() public function setUp()

View File

@@ -16,9 +16,7 @@ use stdClass;
class ChronosDateTimeTypeTest extends TestCase class ChronosDateTimeTypeTest extends TestCase
{ {
/** /** @var ChronosDateTimeType */
* @var ChronosDateTimeType
*/
private $type; private $type;
public function setUp() public function setUp()

View File

@@ -19,21 +19,13 @@ use function array_key_exists;
abstract class AbstractTrackingAction implements MiddlewareInterface abstract class AbstractTrackingAction implements MiddlewareInterface
{ {
/** /** @var UrlShortenerInterface */
* @var UrlShortenerInterface
*/
private $urlShortener; private $urlShortener;
/** /** @var VisitsTrackerInterface */
* @var VisitsTrackerInterface
*/
private $visitTracker; private $visitTracker;
/** /** @var AppOptions */
* @var AppOptions
*/
private $appOptions; private $appOptions;
/** /** @var LoggerInterface */
* @var LoggerInterface
*/
private $logger; private $logger;
public function __construct( public function __construct(

View File

@@ -22,17 +22,11 @@ class PreviewAction implements MiddlewareInterface
use ResponseUtilsTrait; use ResponseUtilsTrait;
use ErrorResponseBuilderTrait; use ErrorResponseBuilderTrait;
/** /** @var PreviewGeneratorInterface */
* @var PreviewGeneratorInterface
*/
private $previewGenerator; private $previewGenerator;
/** /** @var UrlShortenerInterface */
* @var UrlShortenerInterface
*/
private $urlShortener; private $urlShortener;
/** /** @var LoggerInterface */
* @var LoggerInterface
*/
private $logger; private $logger;
public function __construct( public function __construct(

View File

@@ -26,17 +26,11 @@ class QrCodeAction implements MiddlewareInterface
private const MIN_SIZE = 50; private const MIN_SIZE = 50;
private const MAX_SIZE = 1000; private const MAX_SIZE = 1000;
/** /** @var RouterInterface */
* @var RouterInterface
*/
private $router; private $router;
/** /** @var UrlShortenerInterface */
* @var UrlShortenerInterface
*/
private $urlShortener; private $urlShortener;
/** /** @var LoggerInterface */
* @var LoggerInterface
*/
private $logger; private $logger;
public function __construct( public function __construct(

View File

@@ -17,9 +17,7 @@ class RedirectAction extends AbstractTrackingAction
{ {
use ErrorResponseBuilderTrait; use ErrorResponseBuilderTrait;
/** /** @var Options\NotFoundShortUrlOptions */
* @var Options\NotFoundShortUrlOptions
*/
private $notFoundOptions; private $notFoundOptions;
public function __construct( public function __construct(

View File

@@ -8,9 +8,7 @@ use function sprintf;
class DeleteShortUrlException extends RuntimeException class DeleteShortUrlException extends RuntimeException
{ {
/** /** @var int */
* @var int
*/
private $visitsThreshold; private $visitsThreshold;
public function __construct(int $visitsThreshold, string $message = '', int $code = 0, Throwable $previous = null) public function __construct(int $visitsThreshold, string $message = '', int $code = 0, Throwable $previous = null)

View File

@@ -12,9 +12,7 @@ use function sprintf;
class ValidationException extends RuntimeException class ValidationException extends RuntimeException
{ {
/** /** @var array */
* @var array
*/
private $invalidElements; private $invalidElements;
public function __construct( public function __construct(

View File

@@ -12,9 +12,7 @@ use Zend\Diactoros\Response as DiactResp;
class QrCodeCacheMiddleware implements MiddlewareInterface class QrCodeCacheMiddleware implements MiddlewareInterface
{ {
/** /** @var Cache */
* @var Cache
*/
private $cache; private $cache;
public function __construct(Cache $cache) public function __construct(Cache $cache)

View File

@@ -7,17 +7,11 @@ use Psr\Http\Message\UriInterface;
final class CreateShortUrlData final class CreateShortUrlData
{ {
/** /** @var UriInterface */
* @var UriInterface
*/
private $longUrl; private $longUrl;
/** /** @var array */
* @var array
*/
private $tags; private $tags;
/** /** @var ShortUrlMeta */
* @var ShortUrlMeta
*/
private $meta; private $meta;
public function __construct( public function __construct(

View File

@@ -10,21 +10,13 @@ use function is_string;
final class ShortUrlMeta final class ShortUrlMeta
{ {
/** /** @var Chronos|null */
* @var Chronos|null
*/
private $validSince; private $validSince;
/** /** @var Chronos|null */
* @var Chronos|null
*/
private $validUntil; private $validUntil;
/** /** @var string|null */
* @var string|null
*/
private $customSlug; private $customSlug;
/** /** @var int|null */
* @var int|null
*/
private $maxVisits; private $maxVisits;
// Force named constructors // Force named constructors

View File

@@ -9,17 +9,11 @@ final class Visitor
{ {
public const REMOTE_ADDRESS_ATTR = 'remote_address'; public const REMOTE_ADDRESS_ATTR = 'remote_address';
/** /** @var string */
* @var string
*/
private $userAgent; private $userAgent;
/** /** @var string */
* @var string
*/
private $referer; private $referer;
/** /** @var string|null */
* @var string|null
*/
private $remoteAddress; private $remoteAddress;
public function __construct(string $userAgent, string $referer, ?string $remoteAddress) public function __construct(string $userAgent, string $referer, ?string $remoteAddress)

View File

@@ -11,21 +11,13 @@ class AppOptions extends AbstractOptions
{ {
use StringUtilsTrait; use StringUtilsTrait;
/** /** @var string */
* @var string
*/
protected $name = ''; protected $name = '';
/** /** @var string */
* @var string
*/
protected $version = '1.0'; protected $version = '1.0';
/** /** @var string */
* @var string
*/
protected $secretKey = ''; protected $secretKey = '';
/** /** @var string|null */
* @var string|null
*/
protected $disableTrackParam; protected $disableTrackParam;
/** /**

View File

@@ -7,13 +7,9 @@ use Zend\Stdlib\AbstractOptions;
class NotFoundShortUrlOptions extends AbstractOptions class NotFoundShortUrlOptions extends AbstractOptions
{ {
/** /** @var bool */
* @var bool
*/
private $enableRedirection = false; private $enableRedirection = false;
/** /** @var string|null */
* @var string|null
*/
private $redirectTo; private $redirectTo;
public function isRedirectionEnabled(): bool public function isRedirectionEnabled(): bool

View File

@@ -17,13 +17,9 @@ class NotFoundHandler implements RequestHandlerInterface
{ {
public const NOT_FOUND_TEMPLATE = 'notFoundTemplate'; public const NOT_FOUND_TEMPLATE = 'notFoundTemplate';
/** /** @var TemplateRendererInterface */
* @var TemplateRendererInterface
*/
private $renderer; private $renderer;
/** /** @var string */
* @var string
*/
private $defaultTemplate; private $defaultTemplate;
public function __construct(TemplateRendererInterface $renderer, string $defaultTemplate = 'ShlinkCore::error/404') public function __construct(TemplateRendererInterface $renderer, string $defaultTemplate = 'ShlinkCore::error/404')

View File

@@ -12,13 +12,9 @@ class DeleteShortUrlService implements DeleteShortUrlServiceInterface
{ {
use FindShortCodeTrait; use FindShortCodeTrait;
/** /** @var EntityManagerInterface */
* @var EntityManagerInterface
*/
private $em; private $em;
/** /** @var DeleteShortUrlsOptions */
* @var DeleteShortUrlsOptions
*/
private $deleteShortUrlsOptions; private $deleteShortUrlsOptions;
public function __construct(EntityManagerInterface $em, DeleteShortUrlsOptions $deleteShortUrlsOptions) public function __construct(EntityManagerInterface $em, DeleteShortUrlsOptions $deleteShortUrlsOptions)

View File

@@ -18,9 +18,7 @@ class ShortUrlService implements ShortUrlServiceInterface
use FindShortCodeTrait; use FindShortCodeTrait;
use TagManagerTrait; use TagManagerTrait;
/** /** @var ORM\EntityManagerInterface */
* @var ORM\EntityManagerInterface
*/
private $em; private $em;
public function __construct(ORM\EntityManagerInterface $em) public function __construct(ORM\EntityManagerInterface $em)

View File

@@ -14,9 +14,7 @@ class TagService implements TagServiceInterface
{ {
use TagManagerTrait; use TagManagerTrait;
/** /** @var ORM\EntityManagerInterface */
* @var ORM\EntityManagerInterface
*/
private $em; private $em;
public function __construct(ORM\EntityManagerInterface $em) public function __construct(ORM\EntityManagerInterface $em)

View File

@@ -32,25 +32,15 @@ class UrlShortener implements UrlShortenerInterface
public const DEFAULT_CHARS = '123456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ'; public const DEFAULT_CHARS = '123456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ';
private const ID_INCREMENT = 200000; private const ID_INCREMENT = 200000;
/** /** @var ClientInterface */
* @var ClientInterface
*/
private $httpClient; private $httpClient;
/** /** @var EntityManagerInterface */
* @var EntityManagerInterface
*/
private $em; private $em;
/** /** @var string */
* @var string
*/
private $chars; private $chars;
/** /** @var SlugifyInterface */
* @var SlugifyInterface
*/
private $slugger; private $slugger;
/** /** @var bool */
* @var bool
*/
private $urlValidationEnabled; private $urlValidationEnabled;
public function __construct( public function __construct(

View File

@@ -11,9 +11,7 @@ use Shlinkio\Shlink\Core\Repository\VisitRepository;
class VisitService implements VisitServiceInterface class VisitService implements VisitServiceInterface
{ {
/** /** @var EntityManagerInterface */
* @var EntityManagerInterface
*/
private $em; private $em;
public function __construct(EntityManagerInterface $em) public function __construct(EntityManagerInterface $em)

View File

@@ -14,9 +14,7 @@ use function sprintf;
class VisitsTracker implements VisitsTrackerInterface class VisitsTracker implements VisitsTrackerInterface
{ {
/** /** @var ORM\EntityManagerInterface */
* @var ORM\EntityManagerInterface
*/
private $em; private $em;
public function __construct(ORM\EntityManagerInterface $em) public function __construct(ORM\EntityManagerInterface $em)

View File

@@ -12,9 +12,7 @@ class ShortUrlDataTransformer implements DataTransformerInterface
{ {
use ShortUrlBuilderTrait; use ShortUrlBuilderTrait;
/** /** @var array */
* @var array
*/
private $domainConfig; private $domainConfig;
public function __construct(array $domainConfig) public function __construct(array $domainConfig)

View File

@@ -22,9 +22,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
Tag::class, Tag::class,
]; ];
/** /** @var ShortUrlRepository */
* @var ShortUrlRepository
*/
private $repo; private $repo;
public function setUp() public function setUp()

View File

@@ -13,9 +13,7 @@ class TagRepositoryTest extends DatabaseTestCase
Tag::class, Tag::class,
]; ];
/** /** @var TagRepository */
* @var TagRepository
*/
private $repo; private $repo;
protected function setUp() protected function setUp()

View File

@@ -21,9 +21,7 @@ class VisitRepositoryTest extends DatabaseTestCase
ShortUrl::class, ShortUrl::class,
]; ];
/** /** @var VisitRepository */
* @var VisitRepository
*/
private $repo; private $repo;
protected function setUp() protected function setUp()

View File

@@ -18,17 +18,11 @@ use Zend\Diactoros\ServerRequestFactory;
class PixelActionTest extends TestCase class PixelActionTest extends TestCase
{ {
/** /** @var RedirectAction */
* @var RedirectAction
*/
protected $action; protected $action;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $urlShortener; protected $urlShortener;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $visitTracker; protected $visitTracker;
public function setUp() public function setUp()

View File

@@ -23,17 +23,11 @@ use function filesize;
class PreviewActionTest extends TestCase class PreviewActionTest extends TestCase
{ {
/** /** @var PreviewAction */
* @var PreviewAction
*/
protected $action; protected $action;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $previewGenerator; private $previewGenerator;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $urlShortener; private $urlShortener;
public function setUp() public function setUp()

View File

@@ -20,13 +20,9 @@ use Zend\Expressive\Router\RouterInterface;
class QrCodeActionTest extends TestCase class QrCodeActionTest extends TestCase
{ {
/** /** @var QrCodeAction */
* @var QrCodeAction
*/
protected $action; protected $action;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
protected $urlShortener; protected $urlShortener;
public function setUp() public function setUp()

View File

@@ -19,21 +19,13 @@ use Zend\Diactoros\ServerRequestFactory;
class RedirectActionTest extends TestCase class RedirectActionTest extends TestCase
{ {
/** /** @var RedirectAction */
* @var RedirectAction
*/
private $action; private $action;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $urlShortener; private $urlShortener;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $visitTracker; private $visitTracker;
/** /** @var Options\NotFoundShortUrlOptions */
* @var Options\NotFoundShortUrlOptions
*/
private $notFoundOptions; private $notFoundOptions;
public function setUp() public function setUp()

View File

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

View File

@@ -15,13 +15,9 @@ use Zend\Diactoros\Uri;
class QrCodeCacheMiddlewareTest extends TestCase class QrCodeCacheMiddlewareTest extends TestCase
{ {
/** /** @var QrCodeCacheMiddleware */
* @var QrCodeCacheMiddleware
*/
protected $middleware; protected $middleware;
/** /** @var Cache */
* @var Cache
*/
protected $cache; protected $cache;
public function setUp() public function setUp()

View File

@@ -14,13 +14,9 @@ use Zend\Expressive\Template\TemplateRendererInterface;
class NotFoundHandlerTest extends TestCase class NotFoundHandlerTest extends TestCase
{ {
/** /** @var NotFoundHandler */
* @var NotFoundHandler
*/
private $delegate; private $delegate;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $renderer; private $renderer;
public function setUp() public function setUp()

View File

@@ -20,13 +20,9 @@ use function range;
class DeleteShortUrlServiceTest extends TestCase class DeleteShortUrlServiceTest extends TestCase
{ {
/** /** @var DeleteShortUrlService */
* @var DeleteShortUrlService
*/
private $service; private $service;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $em; private $em;
public function setUp() public function setUp()

View File

@@ -19,13 +19,9 @@ use function count;
class ShortUrlServiceTest extends TestCase class ShortUrlServiceTest extends TestCase
{ {
/** /** @var ShortUrlService */
* @var ShortUrlService
*/
protected $service; protected $service;
/** /** @var ObjectProphecy|EntityManagerInterface */
* @var ObjectProphecy|EntityManagerInterface
*/
protected $em; protected $em;
public function setUp() public function setUp()

View File

@@ -16,13 +16,9 @@ use Shlinkio\Shlink\Core\Service\Tag\TagService;
class TagServiceTest extends TestCase class TagServiceTest extends TestCase
{ {
/** /** @var TagService */
* @var TagService
*/
private $service; private $service;
/** /** @var ObjectProphecy */
* @var ObjectProphecy
*/
private $em; private $em;
public function setUp() public function setUp()

Some files were not shown because too many files have changed in this diff Show More