Skip to content

Commit

Permalink
fix cs, phpstan and spellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Jan 1, 2025
1 parent befa4b8 commit 08827f9
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 21 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ sphinx-tabs
sphinxcontrib-phpdomain
sphinxcontrib-spelling
pyenchant

6 changes: 3 additions & 3 deletions doc/symfony-cache-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 0 additions & 7 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/ProxyClient/Cloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/ProxyClient/Fastly.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions src/Test/EventDispatchingHttpCacheTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -480,7 +480,7 @@ class SimpleListener
public function __construct(
EventDispatchingHttpCacheTestCase $test,
CacheInvalidation $kernel,
Request $request
Request $request,
) {
$this->test = $test;
$this->kernel = $kernel;
Expand Down
2 changes: 2 additions & 0 deletions src/Test/PHPUnit/AbstractCacheConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public function __construct(
) {
}

abstract public function getValue(): string;

public function matches($other): bool
{
if (!$other instanceof ResponseInterface) {
Expand Down
3 changes: 3 additions & 0 deletions src/Test/Proxy/AbstractProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 08827f9

Please sign in to comment.