Skip to content

Commit

Permalink
Add support for php 8.1 dependencies (#129)
Browse files Browse the repository at this point in the history
* Add support for php 8.1 dependencies

* Replaced phive with separated composer for tools
  • Loading branch information
norberttech authored Jun 7, 2022
1 parent 5a28da7 commit e5e7567
Show file tree
Hide file tree
Showing 19 changed files with 5,127 additions and 298 deletions.
5 changes: 3 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
*.phpt text eol=lf
/composer.lock export-ignore
/.github/ export-ignore
/.phive/ export-ignore
/tests export-ignore
/tools export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/.php-cs-fixer.php export-ignore
/baseline.xml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
14 changes: 1 addition & 13 deletions .github/workflows/static-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,7 @@ jobs:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
tools: phive, composer:v2

- name: "Cache Phive dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.phive
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
restore-keys: |
${{ runner.os }}-phive-
tools: composer:v2

- name: "Get Composer Cache Directory"
id: composer-cache
Expand All @@ -58,9 +49,6 @@ jobs:
restore-keys: |
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
- name: "Install tools"
run: "phive install --trust-gpg-keys E82B2FB314E9906E,CF1A108D0E7AE720,8A03EA3B385DBAA1,12CE0F1D262429A5 --force-accept-unsigned"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
php-version:
- "7.4"
- "8.0"
- "8.1"
operating-system:
- "ubuntu-latest"

Expand All @@ -36,16 +37,7 @@ jobs:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
tools: phive, composer:v2

- name: "Cache Phive dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.phive
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
restore-keys: |
${{ runner.os }}-phive-
tools: composer:v2

- name: "Get Composer Cache Directory"
id: composer-cache
Expand All @@ -61,9 +53,6 @@ jobs:
restore-keys: |
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
- name: "Install tools"
run: "phive install --trust-gpg-keys E82B2FB314E9906E,CF1A108D0E7AE720,8A03EA3B385DBAA1,12CE0F1D262429A5 --force-accept-unsigned"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
vendor/
bin/
var/
tools/
var/
6 changes: 0 additions & 6 deletions .phive/phars.xml

This file was deleted.

20 changes: 10 additions & 10 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
->files()
->in([
__DIR__ . '/src',
__DIR__ . '/tests'
])
->notName('*.phpt');
__DIR__ . '/tests',
]);

if (!\file_exists(__DIR__ . '/var')) {
\mkdir(__DIR__ . '/var');
Expand All @@ -16,7 +15,9 @@
* This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist
* and slightly adjusted.
*/
return PhpCsFixer\Config::create()
$config = new PhpCsFixer\Config();

return $config
->setRiskyAllowed(true)
->setCacheFile(__DIR__.'/var/.php_cs.cache')
->setRules([
Expand All @@ -30,7 +31,6 @@
'continue',
'declare',
'default',
'die',
'do',
'exit',
'for',
Expand All @@ -50,7 +50,7 @@
],
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
'class_attributes_separation' => ['elements' => ['const'=>'one', 'method'=>'one', 'property'=>'one']],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
Expand All @@ -61,6 +61,7 @@
'dir_constant' => true,
'elseif' => true,
'encoding' => true,
'echo_tag_syntax' => true,
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
'full_opening_tag' => true,
Expand All @@ -85,13 +86,13 @@
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => ['ensure_fully_multiline' => true],
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'modernize_types_casting' => false,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_constant_invocation' => false,
'native_function_casing' => false,
'native_function_invocation' => true,
'native_function_invocation' => ['include'=>['@all']],
'native_function_type_declaration_casing' => true,
'new_with_braces' => false,
'no_alias_functions' => true,
Expand All @@ -112,7 +113,6 @@
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_short_bool_cast' => true,
'no_short_echo_tag' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
Expand Down Expand Up @@ -208,7 +208,7 @@
'standardize_not_equals' => true,
'strict_param' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
Expand Down
29 changes: 15 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
}
],
"require": {
"php": "^7.4 | ^8.0",
"symfony/translation": "^4.4|^5.0",
"symfony/yaml": "^4.4|^5.0",
"php": "~7.4 || ~8.0 || ~8.1",
"symfony/translation": "^4.4|^5.0|^6.0",
"symfony/yaml": "^4.4|^5.0|^6.0",
"aeon-php/calendar": "^0.16.1 || ^1.0"
},
"require-dev": {
Expand Down Expand Up @@ -45,20 +45,21 @@
"@static:analyze",
"@test"
],
"cs:php:fix": [
"tools/php-cs-fixer fix --using-cache=no"
"test": [
"tools/vendor/bin/phpunit"
],
"test" : [
"phpunit"
"static:analyze": [
"tools/vendor/bin/psalm --output-format=compact",
"tools/vendor/bin/phpstan analyze -c phpstan.neon",
"tools/vendor/bin/php-cs-fixer fix --dry-run"
],
"test:mutation": [
"Composer\\Config::disableProcessTimeout",
"tools/infection"
"cs:php:fix": "tools/vendor/bin/php-cs-fixer fix",
"tools:install": "composer install --working-dir=./tools",
"post-install-cmd": [
"@tools:install"
],
"static:analyze": [
"tools/psalm --shepherd --stats",
"tools/phpstan analyze -c phpstan.neon",
"tools/php-cs-fixer fix --dry-run"
"post-update-cmd": [
"@tools:install"
]
}
}
Loading

0 comments on commit e5e7567

Please sign in to comment.