Skip to content

Commit bda77b6

Browse files
committed
Upgrade to latest beta releases
1 parent feb22ee commit bda77b6

11 files changed

Lines changed: 175 additions & 57 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Continuous Integration
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
tests:
9+
strategy:
10+
matrix:
11+
include:
12+
- operating-system: 'windows-latest'
13+
php-version: '8.0'
14+
job-description: 'on Windows'
15+
16+
- operating-system: 'windows-latest'
17+
php-version: '8.1'
18+
job-description: 'on Windows'
19+
20+
name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }}
21+
22+
runs-on: ${{ matrix.operating-system }}
23+
24+
steps:
25+
- name: Set git to use LF
26+
run: |
27+
git config --global core.autocrlf false
28+
git config --global core.eol lf
29+
30+
- name: Checkout code
31+
uses: actions/checkout@v2
32+
33+
- name: Setup PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php-version }}
37+
extensions: fiber-amphp/ext-fiber@master
38+
39+
- name: Get Composer cache directory
40+
id: composer-cache
41+
run: echo "::set-output name=dir::$(composer config cache-dir)"
42+
43+
- name: Cache dependencies
44+
uses: actions/cache@v2
45+
with:
46+
path: ${{ steps.composer-cache.outputs.dir }}
47+
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }}
48+
restore-keys: |
49+
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-
50+
composer-${{ runner.os }}-${{ matrix.php-version }}-
51+
composer-${{ runner.os }}-
52+
composer-
53+
54+
- name: Install dependencies
55+
uses: nick-invision/retry@v2
56+
with:
57+
timeout_minutes: 5
58+
max_attempts: 5
59+
retry_wait_seconds: 30
60+
command: |
61+
composer update --optimize-autoloader --no-interaction --no-progress ${{ matrix.composer-flags }}
62+
composer info -D
63+
64+
- name: Run static analysis
65+
run: vendor/bin/psalm.phar
66+
67+
- name: Run style fixer
68+
env:
69+
PHP_CS_FIXER_IGNORE_ENV: 1
70+
run: vendor/bin/php-cs-fixer --diff --dry-run -v fix

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/vendor/
22
/composer.lock
33
/.php_cs.cache
4+
/composer-require-checker.phar

.php_cs.dist

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
$config = new Amp\CodeStyle\Config();
44
$config->getFinder()
55
->in(__DIR__ . '/examples')
6-
->in(__DIR__ . '/lib');
6+
->in(__DIR__ . '/src');
77

8-
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
9-
10-
$config->setCacheFile($cacheDir . '/.php_cs.cache');
8+
$config->setCacheFile(__DIR__ . '/.php_cs.cache');
119

1210
return $config;

.travis.yml

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

composer-require-check.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"symbol-whitelist": [
3+
"null",
4+
"true",
5+
"false",
6+
"static",
7+
"self",
8+
"parent",
9+
"array",
10+
"string",
11+
"int",
12+
"float",
13+
"bool",
14+
"iterable",
15+
"callable",
16+
"mixed",
17+
"void",
18+
"object"
19+
],
20+
"php-core-extensions": [
21+
"Core",
22+
"date",
23+
"pcre",
24+
"Phar",
25+
"Reflection",
26+
"SPL",
27+
"standard",
28+
"hash"
29+
]
30+
}

composer.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,18 @@
1111
],
1212
"autoload": {
1313
"psr-4": {
14-
"Amp\\WindowsRegistry\\": "lib"
14+
"Amp\\WindowsRegistry\\": "src"
1515
}
1616
},
1717
"prefer-stable": true,
18-
"minimum-stability": "dev",
19-
"repositories": [
20-
{
21-
"type": "vcs",
22-
"url": "git@github.com:revolt-php/event-loop.git"
23-
}
24-
],
18+
"minimum-stability": "beta",
2519
"require": {
26-
"amphp/amp": "dev-v3-revolt",
27-
"amphp/byte-stream": "dev-v2-revolt",
28-
"amphp/process": "dev-v2-revolt"
20+
"php": ">=8",
21+
"amphp/byte-stream": "^2",
22+
"amphp/process": "^2"
2923
},
3024
"require-dev": {
31-
"amphp/php-cs-fixer-config": "dev-master"
25+
"amphp/php-cs-fixer-config": "dev-master",
26+
"psalm/phar": "^4.15"
3227
}
3328
}

examples/dns.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
while ($nameserver === "" && ($key = \array_shift($keys))) {
1919
try {
20-
$nameserver = $reader->read($key);
20+
$nameserver = $reader->read($key) ?? '';
2121
} catch (KeyNotFoundException $e) {
2222
}
2323
}
@@ -28,7 +28,7 @@
2828
foreach ($subKeys as $key) {
2929
foreach (["NameServer", "DhcpNameServer"] as $property) {
3030
try {
31-
$nameserver = ($reader->read("{$key}\\{$property}"));
31+
$nameserver = $reader->read("{$key}\\{$property}") ?? '';
3232

3333
if ($nameserver !== "") {
3434
break 2;

psalm.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
totallyTyped="false"
4+
errorLevel="2"
5+
phpVersion="8.1"
6+
resolveFromConfigFile="true"
7+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8+
xmlns="https://getpsalm.org/schema/config"
9+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
10+
>
11+
<projectFiles>
12+
<directory name="examples"/>
13+
<directory name="src"/>
14+
<ignoreFiles>
15+
<directory name="vendor"/>
16+
</ignoreFiles>
17+
</projectFiles>
18+
19+
<issueHandlers>
20+
<StringIncrement>
21+
<errorLevel type="suppress">
22+
<directory name="examples"/>
23+
<directory name="src"/>
24+
</errorLevel>
25+
</StringIncrement>
26+
27+
<RedundantConditionGivenDocblockType>
28+
<errorLevel type="suppress">
29+
<directory name="src"/>
30+
</errorLevel>
31+
</RedundantConditionGivenDocblockType>
32+
33+
<DocblockTypeContradiction>
34+
<errorLevel type="suppress">
35+
<directory name="src"/>
36+
</errorLevel>
37+
</DocblockTypeContradiction>
38+
39+
<MissingClosureParamType>
40+
<errorLevel type="suppress">
41+
<directory name="examples"/>
42+
<directory name="src"/>
43+
</errorLevel>
44+
</MissingClosureParamType>
45+
46+
<MissingClosureReturnType>
47+
<errorLevel type="suppress">
48+
<directory name="examples"/>
49+
<directory name="src"/>
50+
</errorLevel>
51+
</MissingClosureReturnType>
52+
</issueHandlers>
53+
</psalm>

0 commit comments

Comments
 (0)