Skip to content

Commit 61eec29

Browse files
authored
Merge pull request #46: maintenance
Maintenance
2 parents dddbf4c + d791d23 commit 61eec29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+917
-1143
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.json]
19+
indent_style = space
20+
indent_size = 4

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
* text=auto
2+
3+
/.* export-ignore
4+
/example export-ignore
5+
/tests export-ignore
6+
/*.xml export-ignore
7+
/*.yml export-ignore
8+
/*.lock export-ignore
9+
/*.dist export-ignore
10+
/*.php export-ignore

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: roadrunner-server

.github/workflows/cs-fix.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on:
2+
push:
3+
branches:
4+
- '*'
5+
6+
name: Fix Code Style
7+
8+
jobs:
9+
cs-fix:
10+
permissions:
11+
contents: write
12+
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master

.github/workflows/psalm.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
on:
2+
push:
3+
branches:
4+
- '*.*'
5+
pull_request: null
6+
7+
name: static analysis
8+
9+
jobs:
10+
psalm:
11+
uses: spiral/gh-actions/.github/workflows/psalm.yml@master
12+
with:
13+
os: >-
14+
['ubuntu-latest']

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Dependency directories (remove the comment below to include it)
2-
# vendor/
3-
.idea
4-
vendor
1+
/runtime
2+
/vendor
3+
/.idea
4+
/.env
55
composer.lock

.php-cs-fixer.dist.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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__ . '/bin/rr')
9+
->include(__DIR__ . '/src')
10+
->include(__FILE__)
11+
->allowRisky(true)
12+
->build();

bin/rr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ use Spiral\RoadRunner\Version;
2121
//
2222

2323
if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
24-
$error = vsprintf('Info CLI should be invoked via the CLI version of PHP, not the %s SAPI', [
24+
$error = \vsprintf('Info CLI should be invoked via the CLI version of PHP, not the %s SAPI', [
2525
PHP_SAPI,
2626
]);
2727

28-
fwrite(STDERR, $error);
28+
\fwrite(STDERR, $error);
2929
exit(1);
3030
}
3131

@@ -44,15 +44,15 @@ $composerAutoloadPaths = [
4444
];
4545

4646
foreach ($composerAutoloadPaths as $file) {
47-
if (is_file($file)) {
48-
define('RR_COMPOSER_INSTALL', $file);
47+
if (\is_file($file)) {
48+
\define('RR_COMPOSER_INSTALL', $file);
4949

5050
break;
5151
}
5252
}
5353

54-
if (! defined('RR_COMPOSER_INSTALL')) {
55-
fwrite(STDERR, <<<'RR_CLI_ERROR'
54+
if (! \defined('RR_COMPOSER_INSTALL')) {
55+
\fwrite(STDERR, <<<'RR_CLI_ERROR'
5656
You need to set up the project dependencies using Composer:
5757
5858
composer install

composer.json

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,40 @@
2020
"support": {
2121
"docs": "https://docs.roadrunner.dev",
2222
"issues": "https://github.com/roadrunner-server/roadrunner/issues",
23-
"forum": "https://forum.roadrunner.dev/",
2423
"chat": "https://discord.gg/V6EK4he"
2524
},
25+
"funding": [
26+
{
27+
"type": "github",
28+
"url": "https://github.com/sponsors/roadrunner-server"
29+
}
30+
],
2631
"require": {
27-
"php": ">=7.4",
32+
"php": ">=8.1",
2833
"ext-json": "*",
29-
"composer/semver": "^3.2",
30-
"spiral/roadrunner-worker": ">=2.0.2",
31-
"spiral/tokenizer": "^2.13 || ^3.0",
34+
"composer/semver": "^3.4",
35+
"spiral/roadrunner-worker": "^2 || ^3",
36+
"spiral/tokenizer": "^2.13 || ^3.15",
3237
"symfony/console": "^5.3 || ^6.0 || ^7.0",
33-
"symfony/http-client": "^4.4.11 || ^5.0 || ^6.0 || ^7.0",
34-
"symfony/polyfill-php80": "^1.22",
35-
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
38+
"symfony/http-client": "^4.4.51 || ^5.4.49 || ^6.4.17 || ^7.2",
39+
"symfony/yaml": "^5.4.49 || ^6.4.17 || ^7.2"
3640
},
3741
"require-dev": {
38-
"jetbrains/phpstorm-attributes": "^1.0",
39-
"vimeo/psalm": "^5.17"
40-
},
41-
"scripts": {
42-
"analyze": "psalm"
42+
"jetbrains/phpstorm-attributes": "^1.2",
43+
"spiral/code-style": "^2.2.2",
44+
"spiral/dumper": "^3.3",
45+
"vimeo/psalm": "^6.0"
4346
},
4447
"autoload": {
4548
"psr-4": {
4649
"Spiral\\RoadRunner\\Console\\": "src"
4750
}
4851
},
49-
"extra": {
50-
"branch-alias": {
51-
"dev-master": "2.1.x-dev"
52-
}
52+
"scripts": {
53+
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
54+
"cs:fix": "php-cs-fixer fix -v",
55+
"psalm": "psalm",
56+
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml"
5357
},
5458
"config": {
5559
"sort-packages": true

psalm-baseline.xml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="6.0.0@b8e96bb617bf59382113b1b56cef751f648a7dc9">
3+
<file src="src/Archive/Factory.php">
4+
<RiskyTruthyFalsyComparison>
5+
<code><![CDATA[$temp]]></code>
6+
</RiskyTruthyFalsyComparison>
7+
</file>
8+
<file src="src/Command.php">
9+
<RiskyTruthyFalsyComparison>
10+
<code><![CDATA[$token]]></code>
11+
</RiskyTruthyFalsyComparison>
12+
</file>
13+
<file src="src/Command/Option.php">
14+
<MixedAssignment>
15+
<code><![CDATA[$result]]></code>
16+
</MixedAssignment>
17+
</file>
18+
<file src="src/Command/VersionFilterOption.php">
19+
<InvalidArgument>
20+
<code><![CDATA[\array_unique($versions)]]></code>
21+
</InvalidArgument>
22+
<PossiblyInvalidMethodCall>
23+
<code><![CDATA[sortByVersion]]></code>
24+
</PossiblyInvalidMethodCall>
25+
</file>
26+
<file src="src/Configuration/Generator.php">
27+
<ArgumentTypeCoercion>
28+
<code><![CDATA[new $section()]]></code>
29+
</ArgumentTypeCoercion>
30+
<InvalidReturnType>
31+
<code><![CDATA[non-empty-array<SectionInterface>]]></code>
32+
</InvalidReturnType>
33+
<MismatchingDocblockReturnType>
34+
<code><![CDATA[non-empty-array<SectionInterface>]]></code>
35+
</MismatchingDocblockReturnType>
36+
<MixedAssignment>
37+
<code><![CDATA[$section]]></code>
38+
</MixedAssignment>
39+
<MixedMethodCall>
40+
<code><![CDATA[new $section()]]></code>
41+
</MixedMethodCall>
42+
</file>
43+
<file src="src/Configuration/Plugins.php">
44+
<MixedPropertyTypeCoercion>
45+
<code><![CDATA[$plugins]]></code>
46+
<code><![CDATA[$this->getAvailable()]]></code>
47+
</MixedPropertyTypeCoercion>
48+
</file>
49+
<file src="src/DownloadProtocBinaryCommand.php">
50+
<ArgumentTypeCoercion>
51+
<code><![CDATA[$stabilityOption]]></code>
52+
</ArgumentTypeCoercion>
53+
<PossiblyInvalidMethodCall>
54+
<code><![CDATA[filter]]></code>
55+
</PossiblyInvalidMethodCall>
56+
<PossiblyNullArgument>
57+
<code><![CDATA[$file]]></code>
58+
</PossiblyNullArgument>
59+
</file>
60+
<file src="src/Environment/OperatingSystem.php">
61+
<TooManyArguments>
62+
<code><![CDATA[createFromGlobals]]></code>
63+
</TooManyArguments>
64+
</file>
65+
<file src="src/GetBinaryCommand.php">
66+
<ArgumentTypeCoercion>
67+
<code><![CDATA[$stabilityOption]]></code>
68+
</ArgumentTypeCoercion>
69+
<MixedArgument>
70+
<code><![CDATA[$in->getOption('plugin')]]></code>
71+
<code><![CDATA[$in->getOption('preset')]]></code>
72+
</MixedArgument>
73+
<PossiblyFalseOperand>
74+
<code><![CDATA[\getcwd()]]></code>
75+
</PossiblyFalseOperand>
76+
<PossiblyInvalidMethodCall>
77+
<code><![CDATA[onlyRoadrunner]]></code>
78+
</PossiblyInvalidMethodCall>
79+
<PossiblyNullArgument>
80+
<code><![CDATA[$file]]></code>
81+
</PossiblyNullArgument>
82+
<PossiblyUndefinedVariable>
83+
<code><![CDATA[$config]]></code>
84+
</PossiblyUndefinedVariable>
85+
<UnnecessaryVarAnnotation>
86+
<code><![CDATA[AssetInterface]]></code>
87+
<code><![CDATA[ReleaseInterface]]></code>
88+
</UnnecessaryVarAnnotation>
89+
</file>
90+
<file src="src/MakeConfigCommand.php">
91+
<MixedArgument>
92+
<code><![CDATA[$input->getOption('plugin')]]></code>
93+
<code><![CDATA[$input->getOption('preset')]]></code>
94+
</MixedArgument>
95+
<PossiblyFalseOperand>
96+
<code><![CDATA[\getcwd()]]></code>
97+
</PossiblyFalseOperand>
98+
</file>
99+
<file src="src/Repository/Collection.php">
100+
<UnsafeGenericInstantiation>
101+
<code><![CDATA[new static($items)]]></code>
102+
<code><![CDATA[new static(\array_filter($this->items, $callback))]]></code>
103+
<code><![CDATA[new static(\array_filter($this->items, $filter))]]></code>
104+
<code><![CDATA[new static(\array_map($map, $this->items))]]></code>
105+
</UnsafeGenericInstantiation>
106+
</file>
107+
<file src="src/Repository/GitHub/GitHubRelease.php">
108+
<InvalidArgument>
109+
<code><![CDATA[$release]]></code>
110+
</InvalidArgument>
111+
<InvalidArrayOffset>
112+
<code><![CDATA[$release['tag_name']]]></code>
113+
</InvalidArrayOffset>
114+
<MixedArgument>
115+
<code><![CDATA[$version]]></code>
116+
</MixedArgument>
117+
<MixedAssignment>
118+
<code><![CDATA[$version]]></code>
119+
</MixedAssignment>
120+
</file>
121+
<file src="src/Repository/Release.php">
122+
<LessSpecificReturnStatement>
123+
<code><![CDATA[$this->stability]]></code>
124+
</LessSpecificReturnStatement>
125+
<MoreSpecificReturnType>
126+
<code><![CDATA[string]]></code>
127+
</MoreSpecificReturnType>
128+
</file>
129+
<file src="src/Repository/ReleaseInterface.php">
130+
<MismatchingDocblockReturnType>
131+
<code><![CDATA[AssetsCollection|iterable<AssetInterface>]]></code>
132+
</MismatchingDocblockReturnType>
133+
</file>
134+
<file src="src/Repository/ReleasesCollection.php">
135+
<PossiblyInvalidMethodCall>
136+
<code><![CDATA[empty]]></code>
137+
</PossiblyInvalidMethodCall>
138+
</file>
139+
<file src="src/Repository/RepositoryInterface.php">
140+
<MismatchingDocblockReturnType>
141+
<code><![CDATA[ReleasesCollection|iterable<ReleaseInterface>]]></code>
142+
</MismatchingDocblockReturnType>
143+
</file>
144+
<file src="src/VersionsCommand.php">
145+
<ArgumentTypeCoercion>
146+
<code><![CDATA[$this->stability->get($input, $io)]]></code>
147+
</ArgumentTypeCoercion>
148+
<PossiblyInvalidArgument>
149+
<code><![CDATA[$release->getAssets()]]></code>
150+
</PossiblyInvalidArgument>
151+
<PossiblyInvalidMethodCall>
152+
<code><![CDATA[count]]></code>
153+
<code><![CDATA[empty]]></code>
154+
<code><![CDATA[sortByVersion]]></code>
155+
<code><![CDATA[whereOperatingSystem]]></code>
156+
</PossiblyInvalidMethodCall>
157+
</file>
158+
</files>

0 commit comments

Comments
 (0)