Skip to content

Commit

Permalink
Merge pull request #6 from veewee/php81
Browse files Browse the repository at this point in the history
Add PHP81 support
  • Loading branch information
veewee committed Nov 15, 2021
2 parents a26c827 + 1bc0beb commit 06b552a
Show file tree
Hide file tree
Showing 17 changed files with 74,839 additions and 70,520 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ tools/ export-ignore
/.gitignore export-ignore
/phpunit.xml export-ignore
/phive.xml export-ignore
/php_cs.dist export-ignore
.php-cs-fixer.dist.php export-ignore
/psalm.xml export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/analyzers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4']
php-versions: ['7.4', '8.0', '8.1']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4']
php-versions: ['7.4', '8.0', '8.1']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/functional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.4', '8.0']
php-versions: ['7.4', '8.0', '8.1']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0']
php-versions: ['7.4', '8.0', '8.1']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/vendor/
.phpunit.cache
.php_cs.cache
.php-cs-fixer.cache
composer.lock
infection.log
7 changes: 7 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpunit" version="^9.5.10" installed="9.5.10" location="./tools/phpunit.phar" copy="true"/>
<phar name="psalm" version="^4.12.0" installed="4.12.0" location="./tools/psalm.phar" copy="true"/>
<phar name="infection" version="^0.25" installed="0.25.3" location="./tools/infection.phar" copy="true"/>
<phar name="php-cs-fixer" version="^3.3.2" installed="3.3.2" location="./tools/php-cs-fixer.phar" copy="true"/>
</phive>
19 changes: 14 additions & 5 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setFinder(
\Symfony\Component\Finder\Finder::create()
->in([
Expand All @@ -16,7 +16,9 @@
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'backtick_to_shell_exec' => true,
'blank_line_before_return' => true,
'blank_line_before_statement' => [
'statements' => ['return']
],
'class_keyword_remove' => false,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
Expand Down Expand Up @@ -48,7 +50,9 @@
'no_blank_lines_before_namespace' => false,
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_short_echo_tag' => false,
'echo_tag_syntax' => [
'format' => 'long'
],
'no_superfluous_elseif' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
Expand All @@ -62,7 +66,12 @@
'php_unit_mock' => false,
'php_unit_namespaced' => false,
'php_unit_no_expectation_annotation' => false,
'php_unit_ordered_covers' => true,
'phpdoc_order_by_value' => [
'annotations' => ['covers']
],
'php_unit_method_casing' => [
'case' => 'snake_case',
],
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_strict' => false,
'php_unit_test_annotation' => false,
Expand All @@ -71,7 +80,7 @@
'phpdoc_order' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last'],
'pow_to_exponentiation' => true,
'psr0' => true,
'psr_autoloading' => true,
'random_api_migration' => false,
'simplified_null_return' => true,
'static_lambda' => false,
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^7.4 || ^8.0.0 || ^8.1.0",
"composer-plugin-api": "~2.0"
},
"require-dev": {
Expand All @@ -35,7 +35,7 @@
"scripts": {
"parallel": "ComposerRunParallel\\Scripts\\ParallelScript::initializeAndRun",
"cs": "@fix-cs --dry-run",
"fix-cs": "./tools/php-cs-fixer.phar fix",
"fix-cs": "PHP_CS_FIXER_IGNORE_ENV=1 ./tools/php-cs-fixer.phar fix",
"psalm": "./tools/psalm.phar",
"tests": "./tools/phpunit.phar",
"coverage": "@php ./tools/full-coverage-check.php .phpunit.cache/clover/clover.xml",
Expand Down
7 changes: 0 additions & 7 deletions phive.xml

This file was deleted.

1 change: 0 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
forbidEcho="true"
strictBinaryOperands="true"
phpVersion="7.4"
allowPhpStormGenerics="true"
allowStringToStandInForClass="true"
rememberPropertyAssignmentsAfterCall="false"
skipChecksOnUnresolvableIncludes="false"
Expand Down
1 change: 1 addition & 0 deletions src/Finder/PhpExecutableFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __invoke(): string
throw ParallelException::phpBinaryNotFound();
}

/** @var list<string> $phpArgs */
$phpArgs = $this->finder->findArguments();
$phpArgs = $phpArgs ? ' '.implode(' ', $phpArgs) : '';
$allowUrlFOpenFlag = ' -d allow_url_fopen='.ProcessExecutor::escape(ini_get('allow_url_fopen'));
Expand Down
2 changes: 1 addition & 1 deletion src/Result/ResultMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getResultCode(): int
{
return array_reduce(
$this->map,
fn (int $highest, int $value): int => (int) max($highest, $value),
fn (int $highest, int $value): int => max($highest, $value),
0
);
}
Expand Down
Binary file modified tools/infection.phar
Binary file not shown.
Binary file modified tools/php-cs-fixer.phar
Binary file not shown.
Loading

0 comments on commit 06b552a

Please sign in to comment.