Skip to content
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
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

permissions: {}

jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
- uses: ramsey/composer-install@v3

- run: vendor/bin/phpstan analyse --error-format=github
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
},
"require-dev": {
"mockery/mockery": "^1.6.12",
"pestphp/pest": "^4.1.2"
"pestphp/pest": "^4.1.2",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpstan/phpstan-symfony": "^2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -51,7 +56,8 @@
],
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
},
"sort-packages": true
},
Expand All @@ -67,10 +73,9 @@
"pest:e2e": "XDEBUG_MODE=off pest --group=e2e",
"pest:feature": "pest --group=feature",
"pest:unit": "pest --group=unit",
"test": [
"@composer normalize --dry-run",
"lint": [
"pint --test",
"XDEBUG_MODE=off pest"
"phpstan analyse"
]
}
}
269 changes: 268 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: max
paths:
- bin
- src
2 changes: 1 addition & 1 deletion src/Console/ConstraintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __invoke(
return Command::FAILURE;
}

if (empty($versions)) {
if ($versions === []) {
$this->printError(
$io,
sprintf('No PHP versions could satisfy the constraint "%s".', $constraint)
Expand Down
2 changes: 1 addition & 1 deletion src/Console/ModeOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct()
Mode::description(),
Mode::NAME,
null,
Mode::cases(),
array_column(Mode::cases(), 'value'),
);
}
}
2 changes: 1 addition & 1 deletion src/Console/SourceOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct()
Source::description(),
Source::NAME,
null,
Source::cases(),
array_column(Source::cases(), 'value'),
);
}
}
1 change: 0 additions & 1 deletion src/MinorOnlyMatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function satisfiedBy(string $constraint): array
$versions[] = "{$major}.{$minor}";
}

$versions = array_filter($versions);
$versions = array_filter($versions, static fn (string $version) => ! str_starts_with($version, '.'));
$versions = array_filter($versions, static fn (string $version) => ! str_ends_with($version, '.'));
$versions = array_unique($versions);
Expand Down
Loading