diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 4f62d434..c8f7308c 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -15,8 +15,6 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 - with: - python-version: 3.7 - name: Install dependencies run: | python -m pip install --upgrade setuptools @@ -25,7 +23,4 @@ jobs: run: | make -C doc/ spelling if [[ -s "doc/_build/spelling/output.txt" ]]; then echo "\nSpelling errors found\n" && cat "doc/_build/spelling/output.txt"; fi - - name: Spellcheck - run: | - if [[ -s "doc/_build/spelling/output.txt" ]]; then cat "doc/_build/spelling/output.txt"; fi if [[ -s "doc/_build/spelling/output.txt" ]]; then false; fi diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index f7295829..89c48eb1 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v4 - name: Pull in optional dependencies - run: composer require --no-update phpunit/phpunit toflar/psr6-symfony-http-cache-store:^4.2 + run: composer require --no-update phpunit/phpunit toflar/psr6-symfony-http-cache-store:^4.2 symfony/process - name: Cache Vendor id: cache-vendor diff --git a/doc/Makefile b/doc/Makefile index 3efb7caa..1a35bb06 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -154,5 +154,5 @@ doctest: "results in $(BUILDDIR)/doctest/output.txt." spelling: - $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling + $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) -w $(BUILDDIR)/spelling/output.txt $(BUILDDIR)/spelling @echo "Spelling report generated in $(BUILDDIR)/spelling/output.txt" diff --git a/doc/requirements.txt b/doc/requirements.txt index fab75ae2..8d7c2fc2 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,3 +4,4 @@ sphinx-tabs sphinxcontrib-phpdomain sphinxcontrib-spelling pyenchant + diff --git a/doc/symfony-cache-configuration.rst b/doc/symfony-cache-configuration.rst index b72524e6..c913ed24 100644 --- a/doc/symfony-cache-configuration.rst +++ b/doc/symfony-cache-configuration.rst @@ -351,12 +351,12 @@ but you can customize that in the listener constructor:: new CustomTtlListener('My-TTL-Header'); The custom header is removed before sending the response to the client. -You can enable keeping the custom header with the `keepTtlHeader` parameter:: +You can enable keeping the custom header with the ``keepTtlHeader`` parameter:: new CustomTtlListener('My-TTL-Header', keepTtlHeader: true); -By default if the custom ttl header is not present, the listener falls back to the s-maxage cache-control directive. -To disable this behavior, you can set the `fallbackToSmaxage` parameter to false:: +By default if the custom TTL header is not present, the listener falls back to the ``s-maxage`` cache-control directive. +To disable this behavior, you can set the ``fallbackToSmaxage`` parameter to false:: new CustomTtlListener('My-TTL-Header', fallbackToSmaxage: false); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3fe08f90..77c3651a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,10 +2,3 @@ parameters: level: 1 paths: - src - excludePaths: - analyseAndScan: - # contains code to support legacy phpunit versions - # TODO: clean up the code in this namespace and support fewer phpunit versions - - src/Test/* - # contains BC code to support Symfony 3.4 that would not work with never versions - - src/BaseEvent.php diff --git a/src/ProxyClient/Cloudflare.php b/src/ProxyClient/Cloudflare.php index 21445ed6..8f9bad97 100644 --- a/src/ProxyClient/Cloudflare.php +++ b/src/ProxyClient/Cloudflare.php @@ -54,7 +54,7 @@ class Cloudflare extends HttpProxyClient implements ClearCapable, PurgeCapable, public function __construct( Dispatcher $dispatcher, array $options = [], - ?RequestFactoryInterface $requestFactory = null + ?RequestFactoryInterface $requestFactory = null, ) { if (!function_exists('json_encode')) { throw new \Exception('ext-json is required for cloudflare invalidation'); diff --git a/src/ProxyClient/Fastly.php b/src/ProxyClient/Fastly.php index 1d2bf811..0f7f92ba 100644 --- a/src/ProxyClient/Fastly.php +++ b/src/ProxyClient/Fastly.php @@ -50,7 +50,7 @@ class Fastly extends HttpProxyClient implements ClearCapable, PurgeCapable, Refr public function __construct( Dispatcher $dispatcher, array $options = [], - ?RequestFactoryInterface $requestFactory = null + ?RequestFactoryInterface $requestFactory = null, ) { if (!function_exists('json_encode')) { throw new \Exception('ext-json is required for fastly invalidation'); diff --git a/src/Test/EventDispatchingHttpCacheTestCase.php b/src/Test/EventDispatchingHttpCacheTestCase.php index e30fc9dd..99a4a59e 100644 --- a/src/Test/EventDispatchingHttpCacheTestCase.php +++ b/src/Test/EventDispatchingHttpCacheTestCase.php @@ -400,7 +400,7 @@ class TestListener implements EventSubscriberInterface public function __construct( EventDispatchingHttpCacheTestCase $test, CacheInvalidation $kernel, - Request $request + Request $request, ) { $this->test = $test; $this->kernel = $kernel; @@ -480,7 +480,7 @@ class SimpleListener public function __construct( EventDispatchingHttpCacheTestCase $test, CacheInvalidation $kernel, - Request $request + Request $request, ) { $this->test = $test; $this->kernel = $kernel; diff --git a/src/Test/PHPUnit/AbstractCacheConstraint.php b/src/Test/PHPUnit/AbstractCacheConstraint.php index 1d135884..6f326888 100644 --- a/src/Test/PHPUnit/AbstractCacheConstraint.php +++ b/src/Test/PHPUnit/AbstractCacheConstraint.php @@ -21,6 +21,8 @@ public function __construct( ) { } + abstract public function getValue(): string; + public function matches($other): bool { if (!$other instanceof ResponseInterface) { diff --git a/src/Test/Proxy/AbstractProxy.php b/src/Test/Proxy/AbstractProxy.php index 3b029671..1518c559 100644 --- a/src/Test/Proxy/AbstractProxy.php +++ b/src/Test/Proxy/AbstractProxy.php @@ -93,6 +93,9 @@ protected function wait(int $timeout, callable $callback): bool */ protected function runCommand(string $command, array $arguments): void { + if (!class_exists(Process::class)) { + throw new \RuntimeException('Running commands requires the symfony/process component'); + } $process = new Process(array_merge([$command], $arguments)); $process->run();