Skip to content

Commit 24d9ef3

Browse files
committed
fix cs, phpstan and spellcheck
1 parent befa4b8 commit 24d9ef3

9 files changed

+14
-17
lines changed

.github/workflows/spellcheck.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- name: Set up Python
1717
uses: actions/setup-python@v5
18-
with:
19-
python-version: 3.7
2018
- name: Install dependencies
2119
run: |
2220
python -m pip install --upgrade setuptools
2321
python -m pip install -r doc/requirements.txt
2422
- name: Run spell check
2523
run: |
2624
make -C doc/ spelling
27-
if [[ -s "doc/_build/spelling/output.txt" ]]; then echo "\nSpelling errors found\n" && cat "doc/_build/spelling/output.txt"; fi
25+
if [[ -s "_build/spelling/output.txt" ]]; then echo "\nSpelling errors found\n" && cat "_build/spelling/output.txt"; fi
2826
- name: Spellcheck
2927
run: |
30-
if [[ -s "doc/_build/spelling/output.txt" ]]; then cat "doc/_build/spelling/output.txt"; fi
31-
if [[ -s "doc/_build/spelling/output.txt" ]]; then false; fi
28+
if [[ -s "_build/spelling/output.txt" ]]; then cat "_build/spelling/output.txt"; fi
29+
if [[ -s "_build/spelling/output.txt" ]]; then false; fi

.github/workflows/static.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@v4
1717

1818
- name: Pull in optional dependencies
19-
run: composer require --no-update phpunit/phpunit toflar/psr6-symfony-http-cache-store:^4.2
19+
run: composer require --no-update phpunit/phpunit toflar/psr6-symfony-http-cache-store:^4.2 symfony/process
2020

2121
- name: Cache Vendor
2222
id: cache-vendor

doc/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ sphinx-tabs
44
sphinxcontrib-phpdomain
55
sphinxcontrib-spelling
66
pyenchant
7+

phpstan.neon.dist

-7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,3 @@ parameters:
22
level: 1
33
paths:
44
- src
5-
excludePaths:
6-
analyseAndScan:
7-
# contains code to support legacy phpunit versions
8-
# TODO: clean up the code in this namespace and support fewer phpunit versions
9-
- src/Test/*
10-
# contains BC code to support Symfony 3.4 that would not work with never versions
11-
- src/BaseEvent.php

src/ProxyClient/Cloudflare.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Cloudflare extends HttpProxyClient implements ClearCapable, PurgeCapable,
5454
public function __construct(
5555
Dispatcher $dispatcher,
5656
array $options = [],
57-
?RequestFactoryInterface $requestFactory = null
57+
?RequestFactoryInterface $requestFactory = null,
5858
) {
5959
if (!function_exists('json_encode')) {
6060
throw new \Exception('ext-json is required for cloudflare invalidation');

src/ProxyClient/Fastly.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Fastly extends HttpProxyClient implements ClearCapable, PurgeCapable, Refr
5050
public function __construct(
5151
Dispatcher $dispatcher,
5252
array $options = [],
53-
?RequestFactoryInterface $requestFactory = null
53+
?RequestFactoryInterface $requestFactory = null,
5454
) {
5555
if (!function_exists('json_encode')) {
5656
throw new \Exception('ext-json is required for fastly invalidation');

src/Test/EventDispatchingHttpCacheTestCase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ class TestListener implements EventSubscriberInterface
400400
public function __construct(
401401
EventDispatchingHttpCacheTestCase $test,
402402
CacheInvalidation $kernel,
403-
Request $request
403+
Request $request,
404404
) {
405405
$this->test = $test;
406406
$this->kernel = $kernel;
@@ -480,7 +480,7 @@ class SimpleListener
480480
public function __construct(
481481
EventDispatchingHttpCacheTestCase $test,
482482
CacheInvalidation $kernel,
483-
Request $request
483+
Request $request,
484484
) {
485485
$this->test = $test;
486486
$this->kernel = $kernel;

src/Test/PHPUnit/AbstractCacheConstraint.php

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public function __construct(
2121
) {
2222
}
2323

24+
abstract public function getValue(): string;
25+
2426
public function matches($other): bool
2527
{
2628
if (!$other instanceof ResponseInterface) {

src/Test/Proxy/AbstractProxy.php

+3
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ protected function wait(int $timeout, callable $callback): bool
9393
*/
9494
protected function runCommand(string $command, array $arguments): void
9595
{
96+
if (!class_exists(Process::class)) {
97+
throw new \RuntimeException('Running commands requires the symfony/process component');
98+
}
9699
$process = new Process(array_merge([$command], $arguments));
97100
$process->run();
98101

0 commit comments

Comments
 (0)