Skip to content

Commit

Permalink
apply latest php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Mar 23, 2024
1 parent 49a9970 commit 7bedbc3
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 36 deletions.
9 changes: 7 additions & 2 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,20 @@ div.highlight pre span.nv {
color: #6ab0de
}

div.highlight pre span.k, div.highlight pre span.o {
div.highlight pre span.k,
div.highlight pre span.o,
div.highlight pre span.nt
{
color: #ff8400;
}

div.highlight pre span.mi,
div.highlight pre span.s,
div.highlight pre span.s1,
div.highlight pre span.s2,
div.highlight pre span.sr {
div.highlight pre span.sr,
div.highlight pre span.cp
{
color: #56db3a;
}

Expand Down
3 changes: 1 addition & 2 deletions doc/cache-invalidator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ multiple times. If there are no requests to be sent, flush will simply do nothin
Error handling
--------------

If an error occurs during ``flush()``, the method throws an
:source:`ExceptionCollection <src/Exception/ExceptionCollection.php>`
If an error occurs during ``flush()``, the method throws an ``ExceptionCollection``
that contains an exception for each failed request to the proxy server.

These exception are of two types:
Expand Down
2 changes: 1 addition & 1 deletion doc/fastly-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Caching is enabled by default. All requests that are marked as cacheable will be
Tagging
~~~~~~~

Fastly supports :term:`tagging` out of the box.
Fastly supports cache tagging out of the box.
Configure the tag header to ``Surrogate-Keys``. (``fos_http_cache.tags.response_header`` if you use FOSHttpCacheBundle)

Purge
Expand Down
2 changes: 1 addition & 1 deletion doc/nginx-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ NGINX does not support :term:`purge` functionality out of the box but you can ea
`ngx_cache_purge <https://github.com/FRiCKLE/ngx_cache_purge>`_ module. You just need to compile
NGINX from sources adding ``ngx_cache_purge`` with ``--add-module``.

You can check the script :source:`install-nginx.sh <tests/install-nginx.sh>` to get an idea
You can check the script ``tests/install-nginx.sh`` to get an idea
about the steps you need to perform.

Then configure NGINX for purge requests:
Expand Down
2 changes: 1 addition & 1 deletion doc/proxy-clients.rst
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ The recommended usage of the proxy client is to create an instance of
Implementation Notes
--------------------

Each client is an implementation of :source:`ProxyClient <src/ProxyClient/ProxyClient.php>`.
Each client is an implementation of ``ProxyClient``.
All other interfaces, ``PurgeCapable``, ``RefreshCapable``, ``BanCapable``, ``TagCapable``
and ``ClearCapable`` extend this ``ProxyClient``. So each client implements at least
one of the :ref:`invalidation methods <invalidation methods>` depending on
Expand Down
1 change: 0 additions & 1 deletion doc/response-tagging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ up one header into multiple ones.
This library ships with a ``MaxHeaderValueLengthFormatter`` that does
the splitting for you. You give it an inner formatter and the maximum length like so::


use FOS\HttpCache\TagHeaderFormatter\CommaSeparatedTagHeaderFormatter;
use FOS\HttpCache\TagHeaderFormatter\MaxHeaderValueLengthFormatter

Expand Down
1 change: 1 addition & 0 deletions doc/spelling_word_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cacheable
config
css
Fastly
formatter
getter
getters
hostname
Expand Down
7 changes: 4 additions & 3 deletions doc/testing-your-application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use PHP’s built in web server. Include the WebServerListener in your
.. literalinclude:: ../phpunit.xml.dist
:prepend:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit ...>
<phpunit>
<listeners>
:language: xml
:start-after: <listeners>
Expand Down Expand Up @@ -80,7 +80,8 @@ Compare this library’s configuration to see how the constants are set:
.. literalinclude:: ../phpunit.xml.dist
:prepend:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit ...>
<phpunit>
<php>
:language: xml
:start-after: <php>

Expand Down Expand Up @@ -332,4 +333,4 @@ correctly::
}

For more ideas, see this library’s functional tests in the
:source:`tests/Functional/` directory.
``tests/Functional/`` directory.
2 changes: 1 addition & 1 deletion doc/user-context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ the current user context.
Context Providers
~~~~~~~~~~~~~~~~~

Each provider is passed the :source:`UserContext <src/UserContext/UserContext.php>`
Each provider is passed the ``UserContext``
and updates that with parameters which influence the varied response.

A provider that looks at whether the user is authenticated could look like this::
Expand Down
28 changes: 14 additions & 14 deletions doc/varnish-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ To enable this feature, add the following to ``your_varnish.vcl``:

.. tabs::

.. code-tab:: C 'Varnish 4-6'
.. code-tab:: C Varnish 4-6

include "path-to-config/varnish/fos_purge.vcl";

sub vcl_recv {
call fos_purge_recv;
}

.. code-tab:: C 'Varnish 3'
.. code-tab:: C Varnish 3

include "path-to-config/varnish-3/fos_purge.vcl";

Expand Down Expand Up @@ -100,15 +100,15 @@ To enable this feature, add the following to ``your_varnish.vcl``:

.. tabs::

.. code-tab:: C 'Varnish 4-6'
.. code-tab:: C Varnish 4-6

include "path-to-config/varnish/fos_refresh.vcl";

sub vcl_recv {
call fos_refresh_recv;
}

.. code-tab:: C 'Varnish 3'
.. code-tab:: C Varnish 3

include "path-to-config/varnish-3/fos_refresh.vcl";

Expand All @@ -129,7 +129,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:

.. tabs::

.. code-tab:: C 'Varnish 4-6'
.. code-tab:: C Varnish 4-6

include "path-to-config/varnish/fos_ban.vcl";

Expand All @@ -145,7 +145,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:
call fos_ban_deliver;
}

.. code-tab:: C 'Varnish 3'
.. code-tab:: C Varnish 3

include "path-to-config/varnish-3/fos_ban.vcl";

Expand Down Expand Up @@ -238,7 +238,7 @@ you have to write your own VCL code for tag invalidation. Your custom VCL will
look like this:

.. tabs::
.. tab:: 'Varnish 4-6'
.. tab:: Varnish 4-6

.. code-block:: C
Expand All @@ -247,7 +247,7 @@ look like this:
:emphasize-lines: 17-23,50-51
:linenos:
.. tab:: 'Varnish 3'
.. tab:: Varnish 3

.. code-block:: C
Expand Down Expand Up @@ -293,7 +293,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:

.. tabs::

.. code-tab:: C 'Varnish 4-6'
.. code-tab:: C Varnish 4-6

include "path-to-config/varnish/fos_user_context.vcl";
include "path-to-config/varnish/fos_user_context_url.vcl";
Expand All @@ -314,7 +314,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:
call fos_user_context_deliver;
}

.. code-tab:: C 'Varnish 3'
.. code-tab:: C Varnish 3

include "path-to-config/varnish-3/fos_user_context.vcl";
include "path-to-config/varnish/fos_user_context_url.vcl";
Expand Down Expand Up @@ -418,15 +418,15 @@ Add the following to ``your_varnish.vcl``:

.. tabs::

.. code-tab:: C 'Varnish 4-6'
.. code-tab:: C Varnish 4-6

include "path-to-config/varnish/fos_custom_ttl.vcl";

sub vcl_backend_response {
call fos_custom_ttl_backend_response;
}

.. code-tab:: C 'Varnish 3'
.. code-tab:: C Varnish 3

include "path-to-config/varnish-3/fos_custom_ttl.vcl";

Expand Down Expand Up @@ -459,15 +459,15 @@ To enable this feature, add the following to ``your_varnish.vcl``:

.. tabs::

.. code-tab:: C 'Varnish 4-6'
.. code-tab:: C Varnish 4-6

include "path-to-config/varnish/fos_debug.vcl";

sub vcl_deliver {
call fos_debug_deliver;
}

.. code-tab:: C 'Varnish 3'
.. code-tab:: C Varnish 3

include "path-to-config/varnish-3/fos_debug.vcl";

Expand Down
2 changes: 1 addition & 1 deletion src/ProxyClient/Cloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Cloudflare extends HttpProxyClient implements ClearCapable, PurgeCapable,
public function __construct(
Dispatcher $httpDispatcher,
array $options = [],
RequestFactory $messageFactory = null
?RequestFactory $messageFactory = null
) {
if (!function_exists('json_encode')) {
throw new \Exception('ext-json is required for cloudflare invalidation');
Expand Down
2 changes: 1 addition & 1 deletion src/ProxyClient/Fastly.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Fastly extends HttpProxyClient implements ClearCapable, PurgeCapable, Refr
public function __construct(
Dispatcher $httpDispatcher,
array $options = [],
RequestFactory $messageFactory = null
?RequestFactory $messageFactory = null
) {
if (!function_exists('json_encode')) {
throw new \Exception('ext-json is required for fastly invalidation');
Expand Down
4 changes: 2 additions & 2 deletions src/ProxyClient/HttpDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class HttpDispatcher implements Dispatcher
public function __construct(
array $servers,
$baseUri = '',
HttpAsyncClient $httpClient = null,
UriFactory $uriFactory = null
?HttpAsyncClient $httpClient = null,
?UriFactory $uriFactory = null
) {
if (!$httpClient) {
$httpClient = new PluginClient(
Expand Down
2 changes: 1 addition & 1 deletion src/ProxyClient/HttpProxyClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ abstract class HttpProxyClient implements ProxyClient
public function __construct(
Dispatcher $httpDispatcher,
array $options = [],
RequestFactory $messageFactory = null
?RequestFactory $messageFactory = null
) {
$this->httpDispatcher = $httpDispatcher;
$this->options = $this->configureOptions()->resolve($options);
Expand Down
2 changes: 1 addition & 1 deletion src/SymfonyCache/CacheEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CacheEvent extends BaseEvent
* @param Response|null $response the response, if available
* @param int $requestType the request type (default HttpKernelInterface::MASTER_REQUEST)
*/
public function __construct(CacheInvalidation $kernel, Request $request, Response $response = null, $requestType = HttpKernelInterface::MASTER_REQUEST)
public function __construct(CacheInvalidation $kernel, Request $request, ?Response $response = null, $requestType = HttpKernelInterface::MASTER_REQUEST)
{
$this->kernel = $kernel;
$this->request = $request;
Expand Down
2 changes: 1 addition & 1 deletion src/SymfonyCache/EventDispatchingHttpCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected function invalidate(Request $request, $catch = false): Response
*
* @return Response|null The response to return, which might be provided/altered by a listener
*/
protected function dispatch($name, Request $request, Response $response = null, $requestType = HttpKernelInterface::MASTER_REQUEST): ?Response
protected function dispatch($name, Request $request, ?Response $response = null, $requestType = HttpKernelInterface::MASTER_REQUEST): ?Response
{
if ($this->getEventDispatcher()->hasListeners($name)) {
$event = new CacheEvent($this, $request, $response, $requestType);
Expand Down
2 changes: 1 addition & 1 deletion src/Test/EventDispatchingHttpCacheTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract protected function getCacheClass();
*
* @return CacheInvalidation|EventDispatchingHttpCache|MockObject
*/
protected function getHttpCachePartialMock(array $mockedMethods = null)
protected function getHttpCachePartialMock(?array $mockedMethods = null)
{
$mock = $this
->getMockBuilder($this->getCacheClass())
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Fixtures/Symfony/AppCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AppCache extends HttpCache implements CacheInvalidation
{
use EventDispatchingHttpCache;

public function __construct(HttpKernelInterface $kernel, StoreInterface $store, SurrogateInterface $surrogate = null, array $options = [])
public function __construct(HttpKernelInterface $kernel, StoreInterface $store, ?SurrogateInterface $surrogate = null, array $options = [])
{
parent::__construct($kernel, $store, $surrogate, $options);

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/SymfonyCache/CleanupCacheTagsListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testResponseHeaderIsCleanedUp()
$this->assertFalse($response->headers->has('Foobar'));
}

private function createEvent(Response $response = null)
private function createEvent(?Response $response = null)
{
return new CacheEvent(
$this->createMock(CacheInvalidation::class),
Expand Down

0 comments on commit 7bedbc3

Please sign in to comment.