-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #5478 Use PHPStan (javiereguiluz)
This PR was squashed before being merged into the 4.x branch. Discussion ---------- Use PHPStan This PR adds PHPStan and fixes (most) issues up to level 4. I used PHPStan in the past a bit, but this is the first time I'm using it seriously ... so please, tell me anything I did wrong and anything I'm missing. Thanks! Commits ------- 3c0d9cf Use PHPStan
- Loading branch information
Showing
73 changed files
with
238 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# It checks the PHPStan rules on the entire codebase | ||
name: "Linter: PHPStan" | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
fail-fast: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
phpstan: | ||
name: PHPStan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout code' | ||
uses: actions/checkout@v3 | ||
|
||
- name: 'Install PHP with extensions' | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: none | ||
php-version: 8.2 | ||
tools: composer:v2 | ||
extensions: mbstring, intl, pdo, pdo_sqlite, sqlite3 | ||
ini-values: date.timezone=UTC | ||
|
||
- name: 'Install project dependencies' | ||
run: | | ||
composer require --no-progress --no-scripts --no-plugins symfony/flex | ||
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable | ||
vendor/bin/simple-phpunit install | ||
- name: 'Run PHPStan analysis' | ||
run: vendor/bin/phpstan analyse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Cannot unset offset string on array\\<int, EasyCorp\\\\Bundle\\\\EasyAdminBundle\\\\Dto\\\\ActionDto\\>\\.$#" | ||
count: 1 | ||
path: src/Dto/ActionConfigDto.php | ||
|
||
- | ||
message: "#^Offset string on array\\<int, EasyCorp\\\\Bundle\\\\EasyAdminBundle\\\\Dto\\\\ActionDto\\> on left side of \\?\\? does not exist\\.$#" | ||
count: 1 | ||
path: src/Dto/ActionConfigDto.php | ||
|
||
- | ||
message: "#^Variable method call on Twig\\\\Extension\\\\RuntimeExtensionInterface\\.$#" | ||
count: 1 | ||
path: src/Twig/EasyAdminTwigExtension.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
level: 4 | ||
paths: | ||
- src/ | ||
bootstrapFiles: | ||
- vendor/bin/.phpunit/phpunit/vendor/autoload.php | ||
ignoreErrors: | ||
- '#Cannot use array destructuring on callable.#' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.