Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update CI for PHP 8.4 #122

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ jobs:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
coverage: ['pcov']
code-style: ['no']
code-analysis: ['no']
include:
- php-versions: '7.4'
coverage: 'none'
code-style: 'yes'
code-analysis: 'yes'
- php-versions: '8.4'
coverage: 'none'
code-style: 'no'
code-analysis: 'yes'
steps:
- name: Checkout
Expand Down Expand Up @@ -48,8 +54,8 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Code Analysis (PHP CS-Fixer)
if: matrix.code-analysis == 'yes'
run: php vendor/bin/php-cs-fixer fix --dry-run --diff
if: matrix.code-style == 'yes'
run: PHP_CS_FIXER_IGNORE_ENV=true php vendor/bin/php-cs-fixer fix --dry-run --diff

- name: Code Analysis (PHPStan)
if: matrix.code-analysis == 'yes'
Expand Down
6 changes: 5 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
$config = new PhpCsFixer\Config();
$config->setRules([
'@PSR1' => true,
'@Symfony' => true
'@Symfony' => true,
'nullable_type_declaration' => [
'syntax' => 'question_mark',
],
'nullable_type_declaration_for_default_null_value' => true,
]);
$config->setFinder($finder);
return $config;
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.56",
"phpstan/phpstan": "^1.11",
"friendsofphp/php-cs-fixer": "^3.64",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-strict-rules": "^1.6",
"phpstan/extension-installer": "^1.3",
"phpstan/extension-installer": "^1.4",
"phpunit/phpunit" : "^9.6"
},
"scripts": {
Expand Down
17 changes: 17 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
parameters:
level: 9
reportUnmatchedIgnoredErrors: false
ignoreErrors:
-
message: "#^.* will always evaluate to true\\.$#"
path: tests/*
count: 1
-
message: "#^Offset .* in isset\\(\\) always exists and is not nullable\\.$#"
path: lib/functions.php
count: 3
-
message: "#^Result of && is always true\\.$#"
path: lib/functions.php
count: 1
-
message: "#^Strict comparison using !== between '' and non-falsy-string will always evaluate to true\\.$#"
path: lib/functions.php
count: 1
-
message: "#^Strict comparison using === between false and string will always evaluate to false\\.$#"
path: lib/functions.php
count: 2