Skip to content

Commit

Permalink
Merge pull request #548 from FriendsOfSymfony/cs-fixer
Browse files Browse the repository at this point in the history
cs fix
  • Loading branch information
dbu committed Oct 25, 2023
2 parents 4f54d89 + c4e495c commit 18b4f0a
Show file tree
Hide file tree
Showing 34 changed files with 13 additions and 196 deletions.
6 changes: 5 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: doc/conf.py

Expand All @@ -8,6 +13,5 @@ formats:
- pdf

python:
version: "3.7"
install:
- requirements: doc/requirements.txt
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,10 @@
"psr-4": {
"FOS\\HttpCache\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"php-http/discovery": true
}
}
}
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

# General information about the project.
project = 'FOSHttpCache'
copyright = u'2014–2018, FriendsOfSymfony'
copyright = u'2014–now, FriendsOfSymfony'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
3 changes: 0 additions & 3 deletions src/EventListener/LogListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ public function __construct(LoggerInterface $logger)
$this->logger = $logger;
}

/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array
{
return [
Expand Down
7 changes: 0 additions & 7 deletions src/ProxyClient/Cloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -102,8 +100,6 @@ public function purge($url, array $headers = [])
}

/**
* {@inheritdoc}
*
* @see https://api.cloudflare.com/#zone-purge-all-files
*/
public function clear()
Expand Down Expand Up @@ -153,9 +149,6 @@ protected function queueRequest($method, $url, array $headers, $validateHost = t
);
}

/**
* {@inheritdoc}
*/
protected function configureOptions()
{
$resolver = parent::configureOptions();
Expand Down
12 changes: 0 additions & 12 deletions src/ProxyClient/Fastly.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public function __construct(
}

/**
* {@inheritdoc}
*
* @see https://docs.fastly.com/api/purge#purge_db35b293f8a724717fcf25628d713583
*/
public function invalidateTags(array $tags)
Expand All @@ -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
*/
Expand All @@ -106,9 +102,6 @@ public function purge($url, array $headers = [])
return $this;
}

/**
* {@inheritdoc}
*/
public function refresh($url, array $headers = [])
{
// First soft purge url
Expand All @@ -131,8 +124,6 @@ public function refresh($url, array $headers = [])
}

/**
* {@inheritdoc}
*
* @see https://docs.fastly.com/api/purge#purge_bee5ed1a0cfd541e8b9f970a44718546
*
* Warning:
Expand Down Expand Up @@ -165,9 +156,6 @@ protected function queueRequest($method, $url, array $headers, $validateHost = t
);
}

/**
* {@inheritdoc}
*/
protected function configureOptions()
{
$resolver = parent::configureOptions();
Expand Down
6 changes: 0 additions & 6 deletions src/ProxyClient/HttpDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -125,9 +122,6 @@ public function invalidate(RequestInterface $invalidationRequest, $validateHost
$this->queue[$signature] = $invalidationRequest;
}

/**
* {@inheritdoc}
*/
public function flush()
{
$queue = $this->queue;
Expand Down
3 changes: 0 additions & 3 deletions src/ProxyClient/HttpProxyClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ public function __construct(
$this->requestFactory = $messageFactory ?: MessageFactoryDiscovery::find();
}

/**
* {@inheritdoc}
*/
public function flush()
{
return $this->httpDispatcher->flush();
Expand Down
9 changes: 0 additions & 9 deletions src/ProxyClient/Nginx.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -42,9 +39,6 @@ public function refresh($url, array $headers = [])
return $this;
}

/**
* {@inheritdoc}
*/
public function purge($url, array $headers = [])
{
$purgeUrl = $this->buildPurgeUrl($url);
Expand All @@ -53,9 +47,6 @@ public function purge($url, array $headers = [])
return $this;
}

/**
* {@inheritdoc}
*/
protected function configureOptions()
{
$resolver = parent::configureOptions();
Expand Down
21 changes: 0 additions & 21 deletions src/ProxyClient/Noop.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions src/ProxyClient/Symfony.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,13 @@ 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);

return $this;
}

/**
* {@inheritdoc}
*/
public function refresh($url, array $headers = [])
{
$headers = array_merge($headers, ['Cache-Control' => 'no-cache']);
Expand Down Expand Up @@ -73,9 +67,6 @@ protected function configureOptions()
return $resolver;
}

/**
* {@inheritdoc}
*/
public function invalidateTags(array $tags)
{
$escapedTags = $this->escapeTags($tags);
Expand Down
18 changes: 0 additions & 18 deletions src/ProxyClient/Varnish.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -92,9 +89,6 @@ public function invalidateTags(array $tags)
return $this;
}

/**
* {@inheritdoc}
*/
public function ban(array $headers)
{
$headers = array_merge(
Expand All @@ -107,9 +101,6 @@ public function ban(array $headers)
return $this;
}

/**
* {@inheritdoc}
*/
public function banPath($path, $contentType = null, $hosts = null)
{
if (is_array($hosts)) {
Expand All @@ -133,19 +124,13 @@ 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);

return $this;
}

/**
* {@inheritdoc}
*/
public function refresh($url, array $headers = [])
{
$headers = array_merge($headers, ['Cache-Control' => 'no-cache']);
Expand All @@ -154,9 +139,6 @@ public function refresh($url, array $headers = [])
return $this;
}

/**
* {@inheritdoc}
*/
protected function configureOptions()
{
$resolver = parent::configureOptions();
Expand Down
2 changes: 0 additions & 2 deletions src/SymfonyCache/AccessControlledListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* control on requests.
*
* @author David Buchmann <mail@davidbu.ch>
*
* {@inheritdoc}
*/
abstract class AccessControlledListener implements EventSubscriberInterface
{
Expand Down
3 changes: 0 additions & 3 deletions src/SymfonyCache/CleanupCacheTagsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ public function removeTagsHeader(CacheEvent $e)
$response->headers->remove($this->tagsHeader);
}

/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array
{
return [
Expand Down
5 changes: 0 additions & 5 deletions src/SymfonyCache/CustomTtlListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
* keep s-maxage for 3rd party proxies.
*
* @author David Buchmann <mail@davidbu.ch>
*
* {@inheritdoc}
*/
class CustomTtlListener implements EventSubscriberInterface
{
Expand Down Expand Up @@ -99,9 +97,6 @@ public function cleanResponse(CacheEvent $e)
$response->headers->remove(static::SMAXAGE_BACKUP);
}

/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array
{
return [
Expand Down
5 changes: 0 additions & 5 deletions src/SymfonyCache/DebugListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@
* Add debug information to the response for use in cache tests.
*
* @author David Buchmann <mail@davidbu.ch>
*
* {@inheritdoc}
*/
class DebugListener implements EventSubscriberInterface
{
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array
{
return [
Expand Down
2 changes: 0 additions & 2 deletions src/SymfonyCache/EventDispatchingHttpCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
*
* @author Jérôme Vieilledent <lolautruche@gmail.com> (courtesy of eZ Systems AS)
* @author David Buchmann <mail@davidbu.ch>
*
* {@inheritdoc}
*/
trait EventDispatchingHttpCache
{
Expand Down
Loading

0 comments on commit 18b4f0a

Please sign in to comment.