Skip to content

Commit 29ab72a

Browse files
committed
Forbid execution under PHP 8.0.0
1 parent e029b62 commit 29ab72a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ jobs:
8787
tools: flex
8888
env:
8989
fail-fast: false # disabled as old PHP version cannot run flex
90+
update: ${{ matrix.php-version == '8.0' }} # force update to 8.0.1+, ref https://github.com/shivammathur/setup-php/issues/394#issuecomment-760461251
9091

9192
- name: Get Composer cache directory
9293
id: composer-cache

php-cs-fixer

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ if (defined('HHVM_VERSION_ID')) {
2525
}
2626
} elseif (!defined('PHP_VERSION_ID') || \PHP_VERSION_ID < 50600 || \PHP_VERSION_ID >= 70500) {
2727
fwrite(STDERR, "PHP needs to be a minimum version of PHP 5.6.0 and maximum version of PHP 7.4.*.\n");
28+
fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n");
29+
30+
if (defined('PHP_VERSION_ID') && \PHP_VERSION_ID === 80000) {
31+
fwrite(STDERR, "PHP CS Fixer is not able run on PHP 8.0.0 due to bug in PHP tokenizer (https://bugs.php.net/bug.php?id=80462).\n");
32+
fwrite(STDERR, "Update PHP version to unblock execution.\n");
33+
34+
exit(1);
35+
}
2836

2937
if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {
3038
fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n");

0 commit comments

Comments
 (0)