Skip to content

Commit e5e7567

Browse files
authored
Add support for php 8.1 dependencies (#129)
* Add support for php 8.1 dependencies * Replaced phive with separated composer for tools
1 parent 5a28da7 commit e5e7567

File tree

19 files changed

+5127
-298
lines changed

19 files changed

+5127
-298
lines changed

.gitattributes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
*.phpt text eol=lf
33
/composer.lock export-ignore
44
/.github/ export-ignore
5-
/.phive/ export-ignore
65
/tests export-ignore
6+
/tools export-ignore
77
/.gitattributes export-ignore
88
/.gitignore export-ignore
9-
/.php_cs export-ignore
9+
/.php-cs-fixer.php export-ignore
10+
/baseline.xml export-ignore
1011
/phpstan.neon export-ignore
1112
/phpunit.xml export-ignore

.github/workflows/static-analyze.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,7 @@ jobs:
3333
coverage: "pcov"
3434
php-version: "${{ matrix.php-version }}"
3535
ini-values: memory_limit=-1
36-
tools: phive, composer:v2
37-
38-
- name: "Cache Phive dependencies"
39-
uses: "actions/cache@v2"
40-
with:
41-
path: |
42-
~/.phive
43-
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
44-
restore-keys: |
45-
${{ runner.os }}-phive-
36+
tools: composer:v2
4637

4738
- name: "Get Composer Cache Directory"
4839
id: composer-cache
@@ -58,9 +49,6 @@ jobs:
5849
restore-keys: |
5950
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
6051
61-
- name: "Install tools"
62-
run: "phive install --trust-gpg-keys E82B2FB314E9906E,CF1A108D0E7AE720,8A03EA3B385DBAA1,12CE0F1D262429A5 --force-accept-unsigned"
63-
6452
- name: "Install lowest dependencies"
6553
if: ${{ matrix.dependencies == 'lowest' }}
6654
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

.github/workflows/tests.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
php-version:
2424
- "7.4"
2525
- "8.0"
26+
- "8.1"
2627
operating-system:
2728
- "ubuntu-latest"
2829

@@ -36,16 +37,7 @@ jobs:
3637
coverage: "pcov"
3738
php-version: "${{ matrix.php-version }}"
3839
ini-values: memory_limit=-1
39-
tools: phive, composer:v2
40-
41-
- name: "Cache Phive dependencies"
42-
uses: "actions/cache@v2"
43-
with:
44-
path: |
45-
~/.phive
46-
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
47-
restore-keys: |
48-
${{ runner.os }}-phive-
40+
tools: composer:v2
4941

5042
- name: "Get Composer Cache Directory"
5143
id: composer-cache
@@ -61,9 +53,6 @@ jobs:
6153
restore-keys: |
6254
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
6355
64-
- name: "Install tools"
65-
run: "phive install --trust-gpg-keys E82B2FB314E9906E,CF1A108D0E7AE720,8A03EA3B385DBAA1,12CE0F1D262429A5 --force-accept-unsigned"
66-
6756
- name: "Install lowest dependencies"
6857
if: ${{ matrix.dependencies == 'lowest' }}
6958
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
vendor/
22
bin/
3-
var/
4-
tools/
3+
var/

.phive/phars.xml

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

.php_cs renamed to .php-cs-fixer.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
->files()
55
->in([
66
__DIR__ . '/src',
7-
__DIR__ . '/tests'
8-
])
9-
->notName('*.phpt');
7+
__DIR__ . '/tests',
8+
]);
109

1110
if (!\file_exists(__DIR__ . '/var')) {
1211
\mkdir(__DIR__ . '/var');
@@ -16,7 +15,9 @@
1615
* This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist
1716
* and slightly adjusted.
1817
*/
19-
return PhpCsFixer\Config::create()
18+
$config = new PhpCsFixer\Config();
19+
20+
return $config
2021
->setRiskyAllowed(true)
2122
->setCacheFile(__DIR__.'/var/.php_cs.cache')
2223
->setRules([
@@ -30,7 +31,6 @@
3031
'continue',
3132
'declare',
3233
'default',
33-
'die',
3434
'do',
3535
'exit',
3636
'for',
@@ -50,7 +50,7 @@
5050
],
5151
'braces' => true,
5252
'cast_spaces' => true,
53-
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
53+
'class_attributes_separation' => ['elements' => ['const'=>'one', 'method'=>'one', 'property'=>'one']],
5454
'combine_consecutive_issets' => true,
5555
'combine_consecutive_unsets' => true,
5656
'compact_nullable_typehint' => true,
@@ -61,6 +61,7 @@
6161
'dir_constant' => true,
6262
'elseif' => true,
6363
'encoding' => true,
64+
'echo_tag_syntax' => true,
6465
'explicit_indirect_variable' => true,
6566
'explicit_string_variable' => true,
6667
'full_opening_tag' => true,
@@ -85,13 +86,13 @@
8586
'lowercase_static_reference' => true,
8687
'magic_constant_casing' => true,
8788
'magic_method_casing' => true,
88-
'method_argument_space' => ['ensure_fully_multiline' => true],
89+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
8990
'modernize_types_casting' => false,
9091
'multiline_comment_opening_closing' => true,
9192
'multiline_whitespace_before_semicolons' => true,
9293
'native_constant_invocation' => false,
9394
'native_function_casing' => false,
94-
'native_function_invocation' => true,
95+
'native_function_invocation' => ['include'=>['@all']],
9596
'native_function_type_declaration_casing' => true,
9697
'new_with_braces' => false,
9798
'no_alias_functions' => true,
@@ -112,7 +113,6 @@
112113
'no_null_property_initialization' => true,
113114
'no_php4_constructor' => true,
114115
'no_short_bool_cast' => true,
115-
'no_short_echo_tag' => true,
116116
'no_singleline_whitespace_before_semicolons' => true,
117117
'no_spaces_after_function_name' => true,
118118
'no_spaces_around_offset' => true,
@@ -208,7 +208,7 @@
208208
'standardize_not_equals' => true,
209209
'strict_param' => true,
210210
'ternary_to_null_coalescing' => true,
211-
'trailing_comma_in_multiline_array' => true,
211+
'trailing_comma_in_multiline' => true,
212212
'trim_array_spaces' => true,
213213
'unary_operator_spaces' => true,
214214
'visibility_required' => [

composer.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^7.4 | ^8.0",
19-
"symfony/translation": "^4.4|^5.0",
20-
"symfony/yaml": "^4.4|^5.0",
18+
"php": "~7.4 || ~8.0 || ~8.1",
19+
"symfony/translation": "^4.4|^5.0|^6.0",
20+
"symfony/yaml": "^4.4|^5.0|^6.0",
2121
"aeon-php/calendar": "^0.16.1 || ^1.0"
2222
},
2323
"require-dev": {
@@ -45,20 +45,21 @@
4545
"@static:analyze",
4646
"@test"
4747
],
48-
"cs:php:fix": [
49-
"tools/php-cs-fixer fix --using-cache=no"
48+
"test": [
49+
"tools/vendor/bin/phpunit"
5050
],
51-
"test" : [
52-
"phpunit"
51+
"static:analyze": [
52+
"tools/vendor/bin/psalm --output-format=compact",
53+
"tools/vendor/bin/phpstan analyze -c phpstan.neon",
54+
"tools/vendor/bin/php-cs-fixer fix --dry-run"
5355
],
54-
"test:mutation": [
55-
"Composer\\Config::disableProcessTimeout",
56-
"tools/infection"
56+
"cs:php:fix": "tools/vendor/bin/php-cs-fixer fix",
57+
"tools:install": "composer install --working-dir=./tools",
58+
"post-install-cmd": [
59+
"@tools:install"
5760
],
58-
"static:analyze": [
59-
"tools/psalm --shepherd --stats",
60-
"tools/phpstan analyze -c phpstan.neon",
61-
"tools/php-cs-fixer fix --dry-run"
61+
"post-update-cmd": [
62+
"@tools:install"
6263
]
6364
}
6465
}

0 commit comments

Comments
 (0)