Skip to content

Commit

Permalink
✨ allow phpstan 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanti committed Oct 8, 2024
1 parent 5708181 commit 088fadc
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/run-grumphp-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
php: ['8.2', '8.3', '8.4']
phpstan: ['1', '2']
container:
image: kanti/buildy:${{ matrix.php }}
steps:
- uses: actions/checkout@v2
- run: composer install --no-progress --no-scripts -n
- run: composer require phpstan/phpstan:^${{ matrix.phpstan }}
- run: ./vendor/bin/grumphp run
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor/
composer.lock
var/
26 changes: 19 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
{
"name": "andersundsehr/phpstan-git-files",
"description": "Add all git files into phpstan config automatically",
"license": "LGPL-3.0-or-later",
"type": "library",
"license" : "LGPL-3.0-or-later",
"authors": [
{
"name": "Matthias Vogel",
"email": "[email protected]"
}
],
"require": {
"phpstan/phpstan": "^1.9",
"php": "~8.0 || ~8.1 || ~8.2",
"composer-plugin-api" : "^2.1.0"
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
"composer-plugin-api": "^2.1.0",
"phpstan/phpstan": "^1 || ^2"
},
"require-dev": {
"pluswerk/grumphp-config": "^7.1"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"ergebnis/composer-normalize": true,
"phpro/grumphp": true,
"phpstan/extension-installer": true,
"pluswerk/grumphp-config": true
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-main": "1.0-dev"
}
},
"require-dev": {
"pluswerk/grumphp-config": "^6.1"
"scripts": {
"post-update-cmd": [
"@composer bump -D",
"@composer normalize"
]
}
}
2 changes: 1 addition & 1 deletion extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

$paths = array_filter(explode("\n", (string)shell_exec("git ls-files | xargs ls -d 2>/dev/null | grep '\.php$'")));
$prefix = getcwd() . '/';
$paths = array_map(static fn($path) => $prefix . $path, $paths);
$paths = array_map(static fn($path): string => $prefix . $path, $paths);
return [
'parameters' => [
'paths' => $paths,
Expand Down
1 change: 1 addition & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parameters:
6 changes: 1 addition & 5 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
$rectorConfig->cacheDirectory('./var/cache/rector');

$rectorConfig->paths(
array_filter([
is_dir(__DIR__ . '/src') ? __DIR__ . '/src' : null,
is_dir(__DIR__ . '/extensions') ? __DIR__ . '/extensions' : null,
is_dir(__DIR__ . '/Classes') ? __DIR__ . '/Classes' : null,
])
array_filter(explode("\n", (string)shell_exec("git ls-files | xargs ls -d 2>/dev/null | grep -E '\.(php)$'")))
);

// define sets of rules
Expand Down

0 comments on commit 088fadc

Please sign in to comment.