Skip to content

Commit caa43c9

Browse files
authored
Allow RoadRunner 2025 (#35)
* Allow RoadRunner 2025, update dependencies * Update metafiles * Fix code style * Update psalm baseline
2 parents 8fe68b0 + da71709 commit caa43c9

32 files changed

Lines changed: 299 additions & 266 deletions

.editorconfig

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ indent_style = space
88
indent_size = 4
99
trim_trailing_whitespace = true
1010

11-
[*.{yml, yaml, sh, conf, neon*}]
12-
indent_size = 2
13-
1411
[*.md]
1512
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_size = 2
16+
17+
[*.yaml]
18+
indent_size = 2
19+
20+
[*.json]
21+
indent_style = space
22+
indent_size = 4

.gitattributes

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
* text=auto
22

3-
/.github export-ignore
4-
/tests export-ignore
5-
/examples export-ignore
6-
/.* export-ignore
7-
/phpunit.xml* export-ignore
8-
/phpstan.* export-ignore
9-
/psalm.* export-ignore
10-
/infection.* export-ignore
11-
/codecov.* export-ignore
3+
/.* export-ignore
4+
/config/ export-ignore
5+
/resources/scripts/ export-ignore
6+
/runtime/ export-ignore
7+
/tests/ export-ignore
8+
9+
/*.xml export-ignore
10+
/*.xml.dist export-ignore

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ composer.lock
77

88
# Vendors
99
/vendor
10+
/runtime
1011
**/vendor
1112

1213
# Temp dirs & trash

.php-cs-fixer.dist.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
require_once 'vendor/autoload.php';
6+
7+
return \Spiral\CodeStyle\Builder::create()
8+
->include(__DIR__ . '/src')
9+
->include(__FILE__)
10+
->allowRisky(true)
11+
->build();

composer.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@
3333
"support": {
3434
"docs": "https://docs.roadrunner.dev",
3535
"issues": "https://github.com/roadrunner-server/roadrunner/issues",
36-
"forum": "https://forum.roadrunner.dev/",
3736
"chat": "https://discord.gg/V6EK4he"
3837
},
3938
"require": {
4039
"php": ">=8.1",
4140
"ext-json": "*",
4241
"ext-sockets": "*",
43-
"spiral/roadrunner": "^2023 || ^2024.1"
42+
"spiral/roadrunner": "^2023 || ^2024.1 || ^2025.1"
4443
},
4544
"require-dev": {
46-
"vimeo/psalm": "^5.9",
47-
"google/protobuf": "^3.22",
48-
"rybakit/msgpack": "^0.7",
49-
"phpunit/phpunit": "^10.0",
45+
"google/protobuf": "^3.22 || ^4.0",
46+
"infection/infection": "^0.29.0",
5047
"jetbrains/phpstorm-attributes": "^1.0",
51-
"infection/infection": "^0.26.1"
48+
"phpunit/phpunit": "^10.5.45",
49+
"rybakit/msgpack": "^0.7",
50+
"spiral/code-style": "*",
51+
"vimeo/psalm": "^6.0"
5252
},
5353
"autoload": {
5454
"psr-4": {
@@ -76,14 +76,19 @@
7676
"test": "phpunit --no-coverage --colors=always",
7777
"test-cover": "phpunit --coverage-clover=coverage.xml",
7878
"test-static": "psalm --no-cache",
79-
"test-mutations": "infection"
79+
"test-mutations": "infection",
80+
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
81+
"cs:fix": "php-cs-fixer fix -v",
82+
"psalm": "psalm",
83+
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml"
8084
},
8185
"minimum-stability": "dev",
8286
"prefer-stable": true,
8387
"config": {
8488
"allow-plugins": {
8589
"infection/extension-installer": true,
8690
"composer/package-versions-deprecated": true
87-
}
91+
},
92+
"sort-packages": true
8893
}
8994
}

phpunit.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4+
cacheResultFile="runtime/.phpunit.result.cache"
45
backupGlobals="false"
56
colors="true"
67
processIsolation="false"
@@ -10,14 +11,23 @@
1011
stderr="true"
1112
>
1213
<testsuites>
13-
<testsuite name="Goridge Tests">
14-
<directory>tests</directory>
14+
<testsuite name="Unit">
15+
<directory>tests/Goridge</directory>
1516
</testsuite>
1617
</testsuites>
17-
1818
<coverage>
19+
<report>
20+
<html outputDirectory="runtime/phpunit/coverage"/>
21+
<text outputFile="runtime/phpunit/coverage.txt"/>
22+
<clover outputFile="runtime/phpunit/logs/clover.xml"/>
23+
</report>
24+
</coverage>
25+
<logging>
26+
<junit outputFile="runtime/report.junit.xml"/>
27+
</logging>
28+
<source>
1929
<include>
2030
<directory>src</directory>
2131
</include>
22-
</coverage>
32+
</source>
2333
</phpunit>

psalm-baseline.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="6.10.2@a6c7e2358bbd62d81fca6c149f5c5823ecfcdd2a">
3+
<file src="src/Frame.php">
4+
<PossiblyFalseArgument>
5+
<code><![CDATA[\unpack('L*', \substr($body, 0, $header[1] * 4))]]></code>
6+
</PossiblyFalseArgument>
7+
</file>
8+
<file src="src/RPC/Codec/MsgpackCodec.php">
9+
<MissingClosureParamType>
10+
<code><![CDATA[$options]]></code>
11+
<code><![CDATA[$options]]></code>
12+
<code><![CDATA[$payload]]></code>
13+
</MissingClosureParamType>
14+
<MissingClosureReturnType>
15+
<code><![CDATA[static function (string $payload, $options = null) {]]></code>
16+
</MissingClosureReturnType>
17+
<MixedReturnStatement>
18+
<code><![CDATA[msgpack_pack($payload)]]></code>
19+
</MixedReturnStatement>
20+
<UndefinedFunction>
21+
<code><![CDATA[msgpack_pack($payload)]]></code>
22+
<code><![CDATA[msgpack_unpack($payload)]]></code>
23+
<code><![CDATA[msgpack_unpack($payload, $options)]]></code>
24+
</UndefinedFunction>
25+
</file>
26+
<file src="src/SocketRelay.php">
27+
<DocblockTypeContradiction>
28+
<code><![CDATA[$port < 0 || $port > 65535]]></code>
29+
</DocblockTypeContradiction>
30+
</file>
31+
<file src="src/StreamRelay.php">
32+
<DocblockTypeContradiction>
33+
<code><![CDATA[!\is_resource($in)]]></code>
34+
<code><![CDATA[!\is_resource($out)]]></code>
35+
</DocblockTypeContradiction>
36+
</file>
37+
</files>

psalm.xml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,30 @@
55
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
66
errorLevel="1"
77
resolveFromConfigFile="true"
8-
findUnusedBaselineEntry="false"
8+
findUnusedBaselineEntry="true"
99
findUnusedCode="false"
10-
findUnusedPsalmSuppress="true"
10+
errorBaseline="psalm-baseline.xml"
1111
>
12-
<stubs>
13-
<file name="resources/stubs/msgpack.phpstub" />
14-
</stubs>
15-
<issueHandlers>
16-
<MissingClosureParamType errorLevel="suppress" />
17-
<MissingClosureReturnType errorLevel="suppress" />
18-
<DocblockTypeContradiction errorLevel="suppress" />
19-
<UndefinedDocblockClass >
20-
<errorLevel type="suppress">
21-
<referencedClass name="Socket"/>
22-
</errorLevel>
23-
</UndefinedDocblockClass >
24-
</issueHandlers>
2512
<projectFiles>
2613
<directory name="src" />
2714
<ignoreFiles>
2815
<directory name="vendor" />
2916
</ignoreFiles>
3017
</projectFiles>
18+
<issueHandlers>
19+
<MissingClassConstType errorLevel="suppress" />
20+
<MissingOverrideAttribute errorLevel="suppress" />
21+
<ClassMustBeFinal errorLevel="suppress" />
22+
</issueHandlers>
23+
<forbiddenFunctions>
24+
<function name="dd"/>
25+
<function name="exit"/>
26+
<function name="die"/>
27+
<function name="var_dump"/>
28+
<function name="echo"/>
29+
<function name="print"/>
30+
<function name="trap"/>
31+
<function name="td"/>
32+
<function name="tr"/>
33+
</forbiddenFunctions>
3134
</psalm>

src/BlockingRelayInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@
77
/**
88
* Means that relay can't be used for non-blocking flow.
99
*/
10-
interface BlockingRelayInterface extends RelayInterface
11-
{
12-
}
10+
interface BlockingRelayInterface extends RelayInterface {}

0 commit comments

Comments
 (0)