Skip to content

Commit 8d9905b

Browse files
authored
Merge pull request #40: Update dependencies
2 parents dd0571a + 3c6783e commit 8d9905b

23 files changed

Lines changed: 151 additions & 105 deletions

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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_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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
* text=auto
22

3-
/.github export-ignore
4-
/tests export-ignore
5-
/.* export-ignore
6-
/phpunit.xml* export-ignore
7-
/phpstan.* export-ignore
8-
/psalm.* export-ignore
9-
/infection.* export-ignore
10-
/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.

.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

.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: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
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": {
@@ -42,17 +41,21 @@
4241
"ext-sockets": "*",
4342
"psr/log": "^2.0 || ^3.0",
4443
"spiral/goridge": "^4.1.0",
45-
"spiral/roadrunner": "^2023.1 || ^2024.1",
44+
"spiral/roadrunner": "^2023.1 || ^2024.1 || ^2025.1",
4645
"composer-runtime-api": "^2.0"
4746
},
4847
"require-dev": {
48+
"buggregator/trap": "^1.13",
4949
"jetbrains/phpstorm-attributes": "^1.0",
50-
"phpunit/phpunit": "^10.0",
51-
"vimeo/psalm": "^5.9",
52-
"symfony/var-dumper": "^6.3 || ^7.0"
50+
"phpunit/phpunit": "^10.5.45",
51+
"spiral/code-style": "^2.2",
52+
"vimeo/psalm": "^6.0"
5353
},
5454
"scripts": {
55-
"analyze": "psalm"
55+
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
56+
"cs:fix": "php-cs-fixer fix -v",
57+
"test": "phpunit",
58+
"psalm": "psalm"
5659
},
5760
"autoload": {
5861
"psr-4": {

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="RR Worker Tests">
14-
<directory>tests</directory>
14+
<testsuite name="Unit">
15+
<directory>tests/Unit</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.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,19 @@
1414
<directory name="vendor" />
1515
</ignoreFiles>
1616
</projectFiles>
17+
<issueHandlers>
18+
<MissingOverrideAttribute errorLevel="suppress" />
19+
<ClassMustBeFinal errorLevel="suppress" />
20+
</issueHandlers>
21+
<forbiddenFunctions>
22+
<function name="dd"/>
23+
<function name="exit"/>
24+
<function name="die"/>
25+
<function name="var_dump"/>
26+
<function name="echo"/>
27+
<function name="print"/>
28+
<function name="trap"/>
29+
<function name="td"/>
30+
<function name="tr"/>
31+
</forbiddenFunctions>
1732
</psalm>

src/Environment.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ class Environment implements EnvironmentInterface
2323
*/
2424
public function __construct(
2525
private array $env = [],
26-
) {
26+
) {}
27+
28+
public static function fromGlobals(): self
29+
{
30+
/** @var array<string, string> $env */
31+
$env = [...$_ENV, ...$_SERVER];
32+
33+
return new self($env);
2734
}
2835

2936
public function getMode(): string
@@ -57,17 +64,9 @@ private function get(string $name, string $default = ''): string
5764
{
5865
if (isset($this->env[$name]) || \array_key_exists($name, $this->env)) {
5966
/** @psalm-suppress RedundantCastGivenDocblockType */
60-
return (string)$this->env[$name];
67+
return (string) $this->env[$name];
6168
}
6269

6370
return $default;
6471
}
65-
66-
public static function fromGlobals(): self
67-
{
68-
/** @var array<string, string> $env */
69-
$env = [...$_ENV, ...$_SERVER];
70-
71-
return new self($env);
72-
}
7372
}

src/Exception/RoadRunnerException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
namespace Spiral\RoadRunner\Exception;
66

7-
final class RoadRunnerException extends \RuntimeException
8-
{
9-
}
7+
final class RoadRunnerException extends \RuntimeException {}

0 commit comments

Comments
 (0)