Skip to content

Commit 6b70c27

Browse files
committed
Update tooling (phpcs, psalm, GitHub actions)
1 parent c59dd48 commit 6b70c27

10 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Coding Standard
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
- name: Cache Composer dependencies
1818
uses: actions/cache@v4
1919
with:
@@ -31,10 +31,10 @@ jobs:
3131

3232
steps:
3333
- name: Checkout code
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v5
3535

3636
- name: Psalm
37-
uses: docker://ghcr.io/psalm/psalm-github-actions:6.4.1
37+
uses: docker://ghcr.io/psalm/psalm-github-actions
3838
with:
3939
args: --shepherd
4040

@@ -51,11 +51,13 @@ jobs:
5151
phpunit: "10"
5252
- version: "8.3"
5353
phpunit: "10"
54+
- version: "8.4"
55+
phpunit: "10"
5456

5557
name: "Test: PHP ${{ matrix.php.version }}"
5658

5759
steps:
58-
- uses: actions/checkout@v4
60+
- uses: actions/checkout@v5
5961
- name: Cache Composer dependencies
6062
uses: actions/cache@v4
6163
with:
@@ -65,7 +67,7 @@ jobs:
6567
with:
6668
dev: no
6769
php_version: "${{ matrix.php.version }}"
68-
- uses: php-actions/phpunit@v3
70+
- uses: php-actions/phpunit@v4
6971
env:
7072
XDEBUG_MODE: coverage
7173
with:

.phive/phars.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpunit" version="^10.0.0" installed="10.5.45" location="./tools/phpunit" copy="true"/>
4-
<phar name="psalm" version="~6.4.0" installed="6.4.1" location="./tools/psalm" copy="true"/>
3+
<phar name="phpunit" version="^10.0 || ^11.0" installed="11.5.42" location="./tools/phpunit" copy="true"/>
4+
<phar name="psalm" version="^6.4.0" installed="6.13.1" location="./tools/psalm" copy="true"/>
55
<phar name="phpcpd" version="^6.0.0" installed="6.0.3" location="./tools/phpcpd" copy="true"/>
66
</phive>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"php": ">=8.0"
2323
},
2424
"require-dev": {
25-
"squizlabs/php_codesniffer": ">=3.7"
25+
"squizlabs/php_codesniffer": "^4.0"
2626
},
2727
"prefer-stable": true,
2828
"autoload": {

phpcs.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<exclude name="Generic.Files.LowercasedFilename"/>
2828
<exclude name="Generic.Formatting.DisallowMultipleStatements"/>
2929
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning"/>
30-
<exclude name="Generic.Formatting.NoSpaceAfterCast"/>
30+
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSame"/>
3131
<exclude name="Generic.Formatting.SpaceBeforeCast"/>
3232
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
3333
<exclude name="Generic.Metrics.CyclomaticComplexity"/> <!-- see below -->
@@ -40,10 +40,6 @@
4040
<exclude name="Generic.Strings.UnnecessaryStringConcat"/>
4141
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent"/>
4242
<exclude name="Generic.WhiteSpace.ScopeIndent"/> <!-- see below -->
43-
44-
<!-- temporary -->
45-
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter"/>
46-
<exclude name="Generic.Metrics.NestingLevel"/>
4743
</rule>
4844
<rule ref="Generic.Arrays.ArrayIndent">
4945
<properties>
@@ -57,6 +53,11 @@
5753
<rule ref="Generic.Commenting">
5854
<type>warning</type>
5955
</rule>
56+
<rule ref="Generic.Formatting.SpaceAfterCast">
57+
<properties>
58+
<property name="spacing" value="0"/>
59+
</properties>
60+
</rule>
6061
<rule ref="Generic.Formatting.SpaceAfterNot">
6162
<properties>
6263
<property name="spacing" value="0"/>
@@ -105,7 +106,6 @@
105106
<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
106107
<rule ref="Squiz.Strings.EchoedStrings"/>
107108
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
108-
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
109109
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
110110
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
111111
</ruleset>

psalm.baseline.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
<code>msgpack_serialize($item)</code>
88
<code>msgpack_unserialize($this->current)</code>
99
</UndefinedFunction>
10+
<TooManyArguments>
11+
<code>lz4_compress($serialized)</code>
12+
<code>lz4_uncompress($compressed)</code>
13+
</TooManyArguments>
1014
</file>
1115
</files>

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
</projectFiles>
1616

1717
<issueHandlers>
18+
<MissingOverrideAttribute errorLevel="suppress"/>
1819
</issueHandlers>
1920
</psalm>

src/ArrayBuffer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/**
77
* @template E of object|array|scalar|null
88
* @implements ArrayBufferInterface<E>
9+
* @api
910
* @author Andreas Wahlen
1011
*/
1112
class ArrayBuffer implements ArrayBufferInterface {

src/LargeArrayBuffer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/**
77
* @template E of object|array|scalar|null
88
* @implements ArrayBufferInterface<E>
9+
* @api
910
* @author Andreas Wahlen
1011
*/
1112
class LargeArrayBuffer implements ArrayBufferInterface {

test/ArrayBufferTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static function provideTestData(): array {
2222
/**
2323
* @dataProvider provideTestData
2424
*/
25+
//#[DataProvider('provideTestData')]
2526
public function testBuffer(int $items, int $threshold): void {
2627
$o = new \stdClass();
2728
$o->foo = 'hello world!'.PHP_EOL;

test/LargeArrayBufferTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testToJSON(): void {
107107
$this->assertEquals(json_encode([$o, $o], JSON_THROW_ON_ERROR), $json);
108108
}
109109

110-
public function provideItems(): array {
110+
public static function provideItems(): array {
111111
return [
112112
[['hello world!', 'just another string']]
113113
];

0 commit comments

Comments
 (0)