-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #1498 [ci] implement phpstan for static analysis of the codebase
- Loading branch information
Showing
18 changed files
with
161 additions
and
56 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
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,81 @@ | ||
name: "CI Static Analysis" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'main' | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
env: | ||
PHPUNIT_FLAGS: "-v" | ||
SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit" | ||
|
||
jobs: | ||
coding-standards: | ||
name: "Coding Standards" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- | ||
name: Checkout code | ||
uses: "actions/checkout@v3" | ||
|
||
- | ||
name: Install PHP | ||
uses: "shivammathur/setup-php@v2" | ||
|
||
- | ||
name: Validate composer.json | ||
run: "composer validate --strict --no-check-lock" | ||
|
||
- | ||
name: Composer install | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--no-scripts" | ||
|
||
- | ||
name: Composer install php-cs-fixer | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" | ||
|
||
- | ||
name: Run PHP-CS-Fixer | ||
run: "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff" | ||
|
||
phpstan: | ||
name: PHPStan | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: "actions/checkout@v4" | ||
|
||
- name: Install PHP | ||
uses: "shivammathur/setup-php@v2" | ||
|
||
- name: Install Composer Dependencies | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--no-scripts" | ||
|
||
- name: Install PHPStan | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--no-scripts --working-dir=tools/phpstan" | ||
|
||
- name: Install Optional Dependencies | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--no-scripts --working-dir=tools/phpstan/includes" | ||
|
||
- name: Install PHPUnit | ||
run: "vendor/bin/simple-phpunit --version" | ||
|
||
- name: Run PHPStan | ||
run: "tools/phpstan/vendor/bin/phpstan analyze --memory-limit=1G --error-format=github" |
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,26 @@ | ||
parameters: | ||
level: 6 | ||
bootstrapFiles: | ||
- vendor/autoload.php | ||
- tools/phpstan/includes/vendor/autoload.php | ||
paths: | ||
- src/Maker | ||
- tests/Command | ||
- tests/Docker | ||
- tests/Maker | ||
excludePaths: | ||
- tests/Doctrine/fixtures | ||
- tests/fixtures | ||
- tests/Security/fixtures | ||
- tests/Security/yaml_fixtures | ||
- tests/tmp | ||
- tests/Util/fixtures | ||
- tests/Util/yaml_fixtures | ||
ignoreErrors: | ||
- | ||
message: '#Property .+phpCompatUtil is never read, only written\.#' | ||
path: src/Maker/* | ||
|
||
- | ||
message: '#Class Symfony\\Bundle\\MakerBundle\\Maker\\LegacyApiTestCase not found#' | ||
path: src/Maker/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"require": { | ||
"phpstan/phpstan": "^1.10", | ||
"phpstan/extension-installer": "^1.3", | ||
"phpstan/phpstan-symfony": "^1.3", | ||
"phpstan/phpstan-doctrine": "^1.3", | ||
"phpstan/phpstan-phpunit": "^1.3" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"phpstan/extension-installer": true | ||
} | ||
} | ||
} |
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,3 @@ | ||
* | ||
!.gitignore | ||
!composer.json |
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,22 @@ | ||
{ | ||
"require": { | ||
"api-platform/core": "^3.2", | ||
"doctrine/doctrine-bundle": "^2.12", | ||
"doctrine/doctrine-fixtures-bundle": "^3.5", | ||
"symfony/form": "^7.0", | ||
"symfony/mailer": "^7.0", | ||
"symfony/messenger": "^7.0", | ||
"symfony/orm-pack": "^2.4", | ||
"symfony/scheduler": "^7.0", | ||
"symfony/security-bundle": "^7.0", | ||
"symfony/test-pack": "^1.1", | ||
"symfony/twig-bundle": "^7.0", | ||
"symfony/ux-live-component": "^2.16", | ||
"symfony/ux-turbo": "^2.16", | ||
"symfony/validator": "^7.0", | ||
"symfonycasts/reset-password-bundle": "^1.21", | ||
"symfonycasts/verify-email-bundle": "^1.17", | ||
"symfony/webpack-encore-bundle": "^2.1", | ||
"symfony/panther": "^2.1" | ||
} | ||
} |