diff --git a/composer.json b/composer.json index e57e4410..a9a64adb 100644 --- a/composer.json +++ b/composer.json @@ -55,5 +55,10 @@ "psr-4": { "FOS\\HttpCache\\Tests\\": "tests/" } + }, + "config": { + "allow-plugins": { + "php-http/discovery": true + } } } diff --git a/src/EventListener/LogListener.php b/src/EventListener/LogListener.php index 2e28b914..477574b2 100644 --- a/src/EventListener/LogListener.php +++ b/src/EventListener/LogListener.php @@ -32,9 +32,6 @@ public function __construct(LoggerInterface $logger) $this->logger = $logger; } - /** - * {@inheritdoc} - */ public static function getSubscribedEvents(): array { return [ diff --git a/src/ProxyClient/Cloudflare.php b/src/ProxyClient/Cloudflare.php index 2f26e878..897c61d7 100644 --- a/src/ProxyClient/Cloudflare.php +++ b/src/ProxyClient/Cloudflare.php @@ -82,8 +82,6 @@ public function invalidateTags(array $tags) } /** - * {@inheritdoc} - * * @see https://api.cloudflare.com/#zone-purge-files-by-url * @see https://developers.cloudflare.com/cache/how-to/purge-cache#purge-by-single-file-by-url For details on headers you can pass to clear the cache correctly */ @@ -102,8 +100,6 @@ public function purge($url, array $headers = []) } /** - * {@inheritdoc} - * * @see https://api.cloudflare.com/#zone-purge-all-files */ public function clear() @@ -153,9 +149,6 @@ protected function queueRequest($method, $url, array $headers, $validateHost = t ); } - /** - * {@inheritdoc} - */ protected function configureOptions() { $resolver = parent::configureOptions(); diff --git a/src/ProxyClient/Fastly.php b/src/ProxyClient/Fastly.php index def2fd39..0da42c7a 100644 --- a/src/ProxyClient/Fastly.php +++ b/src/ProxyClient/Fastly.php @@ -58,8 +58,6 @@ public function __construct( } /** - * {@inheritdoc} - * * @see https://docs.fastly.com/api/purge#purge_db35b293f8a724717fcf25628d713583 */ public function invalidateTags(array $tags) @@ -85,8 +83,6 @@ public function invalidateTags(array $tags) } /** - * {@inheritdoc} - * * @see https://docs.fastly.com/api/purge#soft_purge_0c4f56f3d68e9bed44fb8b638b78ea36 * @see https://docs.fastly.com/guides/purging/authenticating-api-purge-requests#purging-urls-with-an-api-token */ @@ -106,9 +102,6 @@ public function purge($url, array $headers = []) return $this; } - /** - * {@inheritdoc} - */ public function refresh($url, array $headers = []) { // First soft purge url @@ -131,8 +124,6 @@ public function refresh($url, array $headers = []) } /** - * {@inheritdoc} - * * @see https://docs.fastly.com/api/purge#purge_bee5ed1a0cfd541e8b9f970a44718546 * * Warning: @@ -165,9 +156,6 @@ protected function queueRequest($method, $url, array $headers, $validateHost = t ); } - /** - * {@inheritdoc} - */ protected function configureOptions() { $resolver = parent::configureOptions(); diff --git a/src/ProxyClient/HttpDispatcher.php b/src/ProxyClient/HttpDispatcher.php index 9e1f2fc8..d643c3da 100644 --- a/src/ProxyClient/HttpDispatcher.php +++ b/src/ProxyClient/HttpDispatcher.php @@ -107,9 +107,6 @@ public function __construct( $this->setBaseUri($baseUri); } - /** - * {@inheritdoc} - */ public function invalidate(RequestInterface $invalidationRequest, $validateHost = true) { if ($validateHost && !$this->baseUri && !$invalidationRequest->getUri()->getHost()) { @@ -125,9 +122,6 @@ public function invalidate(RequestInterface $invalidationRequest, $validateHost $this->queue[$signature] = $invalidationRequest; } - /** - * {@inheritdoc} - */ public function flush() { $queue = $this->queue; diff --git a/src/ProxyClient/HttpProxyClient.php b/src/ProxyClient/HttpProxyClient.php index 2c76ac1e..2ffb841c 100644 --- a/src/ProxyClient/HttpProxyClient.php +++ b/src/ProxyClient/HttpProxyClient.php @@ -63,9 +63,6 @@ public function __construct( $this->requestFactory = $messageFactory ?: MessageFactoryDiscovery::find(); } - /** - * {@inheritdoc} - */ public function flush() { return $this->httpDispatcher->flush(); diff --git a/src/ProxyClient/Nginx.php b/src/ProxyClient/Nginx.php index 722fb706..97deb240 100644 --- a/src/ProxyClient/Nginx.php +++ b/src/ProxyClient/Nginx.php @@ -31,9 +31,6 @@ class Nginx extends HttpProxyClient implements PurgeCapable, RefreshCapable public const HTTP_HEADER_REFRESH = 'X-Refresh'; - /** - * {@inheritdoc} - */ public function refresh($url, array $headers = []) { $headers = array_merge($headers, [self::HTTP_HEADER_REFRESH => '1']); @@ -42,9 +39,6 @@ public function refresh($url, array $headers = []) return $this; } - /** - * {@inheritdoc} - */ public function purge($url, array $headers = []) { $purgeUrl = $this->buildPurgeUrl($url); @@ -53,9 +47,6 @@ public function purge($url, array $headers = []) return $this; } - /** - * {@inheritdoc} - */ protected function configureOptions() { $resolver = parent::configureOptions(); diff --git a/src/ProxyClient/Noop.php b/src/ProxyClient/Noop.php index 7d737776..2d00ff0f 100644 --- a/src/ProxyClient/Noop.php +++ b/src/ProxyClient/Noop.php @@ -28,57 +28,36 @@ */ class Noop implements ProxyClient, BanCapable, PurgeCapable, RefreshCapable, TagCapable, ClearCapable { - /** - * {@inheritdoc} - */ public function ban(array $headers) { return $this; } - /** - * {@inheritdoc} - */ public function banPath($path, $contentType = null, $hosts = null) { return $this; } - /** - * {@inheritdoc} - */ public function invalidateTags(array $tags) { return $this; } - /** - * {@inheritdoc} - */ public function purge($url, array $headers = []) { return $this; } - /** - * {@inheritdoc} - */ public function refresh($url, array $headers = []) { return $this; } - /** - * {@inheritdoc} - */ public function flush() { return 0; } - /** - * {@inheritdoc} - */ public function clear() { return $this; diff --git a/src/ProxyClient/Symfony.php b/src/ProxyClient/Symfony.php index 68ca75de..1d7d7f99 100644 --- a/src/ProxyClient/Symfony.php +++ b/src/ProxyClient/Symfony.php @@ -31,9 +31,6 @@ class Symfony extends HttpProxyClient implements PurgeCapable, RefreshCapable, T { public const HTTP_METHOD_REFRESH = 'GET'; - /** - * {@inheritdoc} - */ public function purge($url, array $headers = []) { $this->queueRequest($this->options['purge_method'], $url, $headers); @@ -41,9 +38,6 @@ public function purge($url, array $headers = []) return $this; } - /** - * {@inheritdoc} - */ public function refresh($url, array $headers = []) { $headers = array_merge($headers, ['Cache-Control' => 'no-cache']); @@ -73,9 +67,6 @@ protected function configureOptions() return $resolver; } - /** - * {@inheritdoc} - */ public function invalidateTags(array $tags) { $escapedTags = $this->escapeTags($tags); diff --git a/src/ProxyClient/Varnish.php b/src/ProxyClient/Varnish.php index ffb854f1..ebf60b3b 100644 --- a/src/ProxyClient/Varnish.php +++ b/src/ProxyClient/Varnish.php @@ -67,9 +67,6 @@ class Varnish extends HttpProxyClient implements BanCapable, PurgeCapable, Refre public const DEFAULT_HTTP_HEADER_CACHE_XKEY = 'xkey-softpurge'; - /** - * {@inheritdoc} - */ public function invalidateTags(array $tags) { $banMode = self::TAG_BAN === $this->options['tag_mode']; @@ -92,9 +89,6 @@ public function invalidateTags(array $tags) return $this; } - /** - * {@inheritdoc} - */ public function ban(array $headers) { $headers = array_merge( @@ -107,9 +101,6 @@ public function ban(array $headers) return $this; } - /** - * {@inheritdoc} - */ public function banPath($path, $contentType = null, $hosts = null) { if (is_array($hosts)) { @@ -133,9 +124,6 @@ public function banPath($path, $contentType = null, $hosts = null) return $this->ban($headers); } - /** - * {@inheritdoc} - */ public function purge($url, array $headers = []) { $this->queueRequest(self::HTTP_METHOD_PURGE, $url, $headers); @@ -143,9 +131,6 @@ public function purge($url, array $headers = []) return $this; } - /** - * {@inheritdoc} - */ public function refresh($url, array $headers = []) { $headers = array_merge($headers, ['Cache-Control' => 'no-cache']); @@ -154,9 +139,6 @@ public function refresh($url, array $headers = []) return $this; } - /** - * {@inheritdoc} - */ protected function configureOptions() { $resolver = parent::configureOptions(); diff --git a/src/SymfonyCache/AccessControlledListener.php b/src/SymfonyCache/AccessControlledListener.php index c88bd682..c77363d7 100644 --- a/src/SymfonyCache/AccessControlledListener.php +++ b/src/SymfonyCache/AccessControlledListener.php @@ -22,8 +22,6 @@ * control on requests. * * @author David Buchmann - * - * {@inheritdoc} */ abstract class AccessControlledListener implements EventSubscriberInterface { diff --git a/src/SymfonyCache/CleanupCacheTagsListener.php b/src/SymfonyCache/CleanupCacheTagsListener.php index 95c041b7..2de9d5a6 100644 --- a/src/SymfonyCache/CleanupCacheTagsListener.php +++ b/src/SymfonyCache/CleanupCacheTagsListener.php @@ -44,9 +44,6 @@ public function removeTagsHeader(CacheEvent $e) $response->headers->remove($this->tagsHeader); } - /** - * {@inheritdoc} - */ public static function getSubscribedEvents(): array { return [ diff --git a/src/SymfonyCache/CustomTtlListener.php b/src/SymfonyCache/CustomTtlListener.php index 8f8c09fa..850fe184 100644 --- a/src/SymfonyCache/CustomTtlListener.php +++ b/src/SymfonyCache/CustomTtlListener.php @@ -20,8 +20,6 @@ * keep s-maxage for 3rd party proxies. * * @author David Buchmann - * - * {@inheritdoc} */ class CustomTtlListener implements EventSubscriberInterface { @@ -99,9 +97,6 @@ public function cleanResponse(CacheEvent $e) $response->headers->remove(static::SMAXAGE_BACKUP); } - /** - * {@inheritdoc} - */ public static function getSubscribedEvents(): array { return [ diff --git a/src/SymfonyCache/DebugListener.php b/src/SymfonyCache/DebugListener.php index 54e1b36c..b3738e88 100644 --- a/src/SymfonyCache/DebugListener.php +++ b/src/SymfonyCache/DebugListener.php @@ -19,14 +19,9 @@ * Add debug information to the response for use in cache tests. * * @author David Buchmann - * - * {@inheritdoc} */ class DebugListener implements EventSubscriberInterface { - /** - * {@inheritdoc} - */ public static function getSubscribedEvents(): array { return [ diff --git a/src/SymfonyCache/EventDispatchingHttpCache.php b/src/SymfonyCache/EventDispatchingHttpCache.php index 77b6e54b..768df9c8 100644 --- a/src/SymfonyCache/EventDispatchingHttpCache.php +++ b/src/SymfonyCache/EventDispatchingHttpCache.php @@ -37,8 +37,6 @@ * * @author Jérôme Vieilledent (courtesy of eZ Systems AS) * @author David Buchmann - * - * {@inheritdoc} */ trait EventDispatchingHttpCache { diff --git a/src/SymfonyCache/KernelDispatcher.php b/src/SymfonyCache/KernelDispatcher.php index c2251b74..16e96222 100644 --- a/src/SymfonyCache/KernelDispatcher.php +++ b/src/SymfonyCache/KernelDispatcher.php @@ -47,9 +47,6 @@ public function __construct(HttpCacheProvider $httpCacheProvider) $this->httpCacheProvider = $httpCacheProvider; } - /** - * {@inheritdoc} - */ public function invalidate(RequestInterface $invalidationRequest, $validateHost = true) { $request = Request::create( @@ -85,9 +82,6 @@ public function invalidate(RequestInterface $invalidationRequest, $validateHost $this->queue[sha1($request)] = $request; } - /** - * {@inheritdoc} - */ public function flush() { if (!count($this->queue)) { diff --git a/src/SymfonyCache/PurgeListener.php b/src/SymfonyCache/PurgeListener.php index c6a85bb1..d146ae3c 100644 --- a/src/SymfonyCache/PurgeListener.php +++ b/src/SymfonyCache/PurgeListener.php @@ -20,8 +20,6 @@ * * @author David Buchmann * @author Yanick Witschi - * - * {@inheritdoc} */ class PurgeListener extends AccessControlledListener { @@ -63,9 +61,6 @@ public function __construct(array $options = []) $this->clearCacheHeader = $options['clear_cache_header']; } - /** - * {@inheritdoc} - */ public static function getSubscribedEvents(): array { return [ diff --git a/src/SymfonyCache/PurgeTagsListener.php b/src/SymfonyCache/PurgeTagsListener.php index d9fa961d..90649dfa 100644 --- a/src/SymfonyCache/PurgeTagsListener.php +++ b/src/SymfonyCache/PurgeTagsListener.php @@ -21,8 +21,6 @@ * Purge tags handler for the Symfony built-in HttpCache. * * @author Yanick Witschi - * - * {@inheritdoc} */ class PurgeTagsListener extends AccessControlledListener { @@ -75,9 +73,6 @@ public function __construct(array $options = []) $this->tagsParser = $options['tags_parser']; } - /** - * {@inheritdoc} - */ public static function getSubscribedEvents(): array { return [ diff --git a/src/SymfonyCache/RefreshListener.php b/src/SymfonyCache/RefreshListener.php index 1c4f2761..5807355a 100644 --- a/src/SymfonyCache/RefreshListener.php +++ b/src/SymfonyCache/RefreshListener.php @@ -20,14 +20,9 @@ * public. * * @author David Buchmann - * - * {@inheritdoc} */ class RefreshListener extends AccessControlledListener { - /** - * {@inheritdoc} - */ public static function getSubscribedEvents(): array { return [ diff --git a/src/SymfonyCache/UserContextListener.php b/src/SymfonyCache/UserContextListener.php index 36242cda..c5c46cc9 100644 --- a/src/SymfonyCache/UserContextListener.php +++ b/src/SymfonyCache/UserContextListener.php @@ -22,8 +22,6 @@ * Caching proxy side of the user context handling for the symfony built-in HttpCache. * * @author Jérôme Vieilledent (courtesy of eZ Systems AS) - * - * {@inheritdoc} */ class UserContextListener implements EventSubscriberInterface { @@ -85,9 +83,6 @@ public function __construct(array $options = []) $this->options = $resolver->resolve($options); } - /** - * {@inheritdoc} - */ public static function getSubscribedEvents(): array { return [ diff --git a/src/TagHeaderFormatter/CommaSeparatedTagHeaderFormatter.php b/src/TagHeaderFormatter/CommaSeparatedTagHeaderFormatter.php index 67be51bb..36ddc500 100644 --- a/src/TagHeaderFormatter/CommaSeparatedTagHeaderFormatter.php +++ b/src/TagHeaderFormatter/CommaSeparatedTagHeaderFormatter.php @@ -38,17 +38,11 @@ public function __construct($headerName = TagHeaderFormatter::DEFAULT_HEADER_NAM $this->glue = $glue; } - /** - * {@inheritdoc} - */ public function getTagsHeaderName() { return $this->headerName; } - /** - * {@inheritdoc} - */ public function getTagsHeaderValue(array $tags) { return implode($this->glue, $tags); diff --git a/src/TagHeaderFormatter/MaxHeaderValueLengthFormatter.php b/src/TagHeaderFormatter/MaxHeaderValueLengthFormatter.php index e00c936f..aa051697 100644 --- a/src/TagHeaderFormatter/MaxHeaderValueLengthFormatter.php +++ b/src/TagHeaderFormatter/MaxHeaderValueLengthFormatter.php @@ -47,17 +47,11 @@ public function __construct(TagHeaderFormatter $inner, $maxHeaderValueLength = 4 $this->maxHeaderValueLength = $maxHeaderValueLength; } - /** - * {@inheritdoc} - */ public function getTagsHeaderName() { return $this->inner->getTagsHeaderName(); } - /** - * {@inheritdoc} - */ public function getTagsHeaderValue(array $tags) { $values = (array) $this->inner->getTagsHeaderValue($tags); diff --git a/src/Test/PHPUnit/AbstractCacheConstraintTrait.php b/src/Test/PHPUnit/AbstractCacheConstraintTrait.php index a9ec3a15..0d659721 100644 --- a/src/Test/PHPUnit/AbstractCacheConstraintTrait.php +++ b/src/Test/PHPUnit/AbstractCacheConstraintTrait.php @@ -38,8 +38,6 @@ public function __construct($header = null) } /** - * {@inheritdoc} - * * @param ResponseInterface $other The guzzle response object */ public function matches($other): bool @@ -75,9 +73,6 @@ public function matches($other): bool return false !== strpos((string) $other->getHeaderLine($this->header), $this->getValue()); } - /** - * {@inheritdoc} - */ public function failureDescription($other): string { return sprintf( diff --git a/src/Test/PHPUnit/IsCacheHitConstraint.php b/src/Test/PHPUnit/IsCacheHitConstraint.php index b4322f4c..13d36936 100644 --- a/src/Test/PHPUnit/IsCacheHitConstraint.php +++ b/src/Test/PHPUnit/IsCacheHitConstraint.php @@ -13,17 +13,11 @@ class IsCacheHitConstraint extends AbstractCacheConstraint { - /** - * {@inheritdoc} - */ public function toString(): string { return 'is a cache hit'; } - /** - * {@inheritdoc} - */ public function getValue() { return 'HIT'; diff --git a/src/Test/PHPUnit/IsCacheMissConstraint.php b/src/Test/PHPUnit/IsCacheMissConstraint.php index 7b79b16c..52e04b25 100644 --- a/src/Test/PHPUnit/IsCacheMissConstraint.php +++ b/src/Test/PHPUnit/IsCacheMissConstraint.php @@ -13,17 +13,11 @@ class IsCacheMissConstraint extends AbstractCacheConstraint { - /** - * {@inheritdoc} - */ public function toString(): string { return 'is a cache miss'; } - /** - * {@inheritdoc} - */ public function getValue() { return 'MISS'; diff --git a/src/Test/Proxy/NginxProxy.php b/src/Test/Proxy/NginxProxy.php index 25253bba..727094cb 100644 --- a/src/Test/Proxy/NginxProxy.php +++ b/src/Test/Proxy/NginxProxy.php @@ -34,9 +34,6 @@ public function __construct($configFile) $this->setCacheDir(sys_get_temp_dir().DIRECTORY_SEPARATOR.'foshttpcache-nginx'); } - /** - * {@inheritdoc} - */ public function start() { $this->runCommand( @@ -50,9 +47,6 @@ public function start() $this->waitFor($this->getIp(), $this->getPort(), 2000); } - /** - * {@inheritdoc} - */ public function stop() { if (file_exists($this->pid)) { @@ -60,9 +54,6 @@ public function stop() } } - /** - * {@inheritdoc} - */ public function clear() { $this->runCommand('rm', ['-rf', $this->getCacheDir()]); diff --git a/src/Test/Proxy/VarnishProxy.php b/src/Test/Proxy/VarnishProxy.php index 6dfa6e31..e104c243 100644 --- a/src/Test/Proxy/VarnishProxy.php +++ b/src/Test/Proxy/VarnishProxy.php @@ -11,9 +11,6 @@ namespace FOS\HttpCache\Test\Proxy; -/** - * {@inheritdoc} - */ class VarnishProxy extends AbstractProxy { protected $binary = 'varnishd'; @@ -43,9 +40,6 @@ public function __construct($configFile) $this->setCacheDir(sys_get_temp_dir().DIRECTORY_SEPARATOR.'foshttpcache-varnish'); } - /** - * {@inheritdoc} - */ public function start() { $vclPath = ((int) $this->getVarnishVersion()) >= 5 ? 'vcl_path' : 'vcl_dir'; @@ -69,9 +63,6 @@ public function start() $this->waitFor($this->ip, $this->getPort(), 5000); } - /** - * {@inheritdoc} - */ public function stop() { if (file_exists($this->pid)) { @@ -85,9 +76,6 @@ public function stop() } } - /** - * {@inheritdoc} - */ public function clear() { $this->stop(); diff --git a/src/Test/VarnishTest.php b/src/Test/VarnishTest.php index 6fa7788e..6dc5f759 100644 --- a/src/Test/VarnishTest.php +++ b/src/Test/VarnishTest.php @@ -142,9 +142,6 @@ protected function getVarnishVersion() return getenv('VARNISH_VERSION') ?: '4.0'; } - /** - * {@inheritdoc} - */ protected function getProxy() { if (null === $this->proxy) { diff --git a/tests/Functional/ProxyClient/InvalidateTagsAssertions.php b/tests/Functional/ProxyClient/InvalidateTagsAssertions.php index 8de4075f..3d0c4371 100644 --- a/tests/Functional/ProxyClient/InvalidateTagsAssertions.php +++ b/tests/Functional/ProxyClient/InvalidateTagsAssertions.php @@ -23,7 +23,6 @@ trait InvalidateTagsAssertions * Asserting that purging cache tags leads to invalidated content. * * @param PurgeCapable $proxyClient The client to send purge instructions to the cache - * @param array $tags The cache tags to invalidate * @param string $path The path to get and purge, defaults to /tags.php */ protected function assertInvalidateTags(TagCapable $proxyClient, array $cacheTags, $path = '/tags.php') diff --git a/tests/Functional/Varnish/UserContextCacheTest.php b/tests/Functional/Varnish/UserContextCacheTest.php index bb60dd15..91c24d98 100644 --- a/tests/Functional/Varnish/UserContextCacheTest.php +++ b/tests/Functional/Varnish/UserContextCacheTest.php @@ -27,9 +27,6 @@ protected function getConfigFile() } } - /** - * {@inheritdoc} - */ protected function assertContextCache($status) { $this->assertEquals('HIT', $status); diff --git a/tests/Functional/Varnish/UserContextNocacheTest.php b/tests/Functional/Varnish/UserContextNocacheTest.php index dd4440e7..d8b7a074 100644 --- a/tests/Functional/Varnish/UserContextNocacheTest.php +++ b/tests/Functional/Varnish/UserContextNocacheTest.php @@ -27,9 +27,6 @@ protected function getConfigFile() } } - /** - * {@inheritdoc} - */ protected function assertContextCache($status) { $this->assertEquals('MISS', $status); diff --git a/tests/Unit/TagHeaderFormatter/MaxHeaderValueLengthFormatterTest.php b/tests/Unit/TagHeaderFormatter/MaxHeaderValueLengthFormatterTest.php index 6255f63a..9d7e2697 100644 --- a/tests/Unit/TagHeaderFormatter/MaxHeaderValueLengthFormatterTest.php +++ b/tests/Unit/TagHeaderFormatter/MaxHeaderValueLengthFormatterTest.php @@ -35,9 +35,8 @@ public function testNotTooLong() /** * @dataProvider tooLongProvider * - * @param int $maxLength - * @param array $tags - * @param mixed $expectedHeaderValue + * @param int $maxLength + * @param string[] $tags */ public function testTooLong($maxLength, $tags, $expectedHeaderValue) {