mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-09 23:56:14 +01:00

[FEATURE] Add type checking via PHPStan (#218)

This commit is contained in:
Oliver Klee 2021-03-17 01:08:40 +01:00 committed by GitHub
parent fc1b690294
commit db1080b119
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 0 deletions

1
.gitattributes vendored
View file

@ -14,4 +14,5 @@
/codeception.yml export-ignore
/phive.xml
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/tools/ export-ignore binary

View file

@ -63,6 +63,7 @@ jobs:
- "php:sniff"
- "php:codestyle"
- "php:copypaste"
- "php:stan"
- "composer:normalize"
php-version:
- 7.4

View file

@ -298,6 +298,17 @@ php-copypaste-check:
script:
- composer ci:php:copypaste
phpstan:
extends: .default
stage: codestyle
needs:
- build-composer-dependencies
- php-lint-php7.2
- php-lint-php7.3
- php-lint-php7.4
script:
- composer ci:php:stan
composer-normalize:
extends: .default
stage: codestyle

View file

@ -37,6 +37,10 @@ All of those checks are available in Github Actions and in Gitlab CI.
`composer ci:php:copypaste`
### PHP type checking by [PHPStan](https://github.com/phpstan/phpstan)
`composer ci:php:stan`
### JSON Lint check by [jsonlint](https://github.com/Seldaek/jsonlint)
`composer ci:json:lint`

View file

@ -89,6 +89,7 @@
"ci:php:copypaste": "php ./tools/phpcpd Classes Configuration Tests",
"ci:php:lint": "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l",
"ci:php:sniff": "php ./tools/phpcs Classes Configuration Tests",
"ci:php:stan": "php ./tools/phpstan analyse Classes",
"ci:static": [
"@ci:php:lint",
"@ci:php:sniff",

View file

@ -6,4 +6,5 @@
<phar name="ergebnis/composer-normalize" version="^2.13.2" location="./tools/composer-normalize" copy="true" installed="2.13.2"/>
<phar name="friendsofphp/php-cs-fixer" version="^2.18.2" location="./tools/php-cs-fixer" copy="true" installed="2.18.2"/>
<phar name="martin-helmich/typo3-typoscript-lint" version="^2.4.1" location="./tools/typo3-typoscript-lint" copy="true" installed="2.4.1"/>
<phar name="phpstan" version="^0.12.81" installed="0.12.81" location="./tools/phpstan" copy="true"/>
</phive>

7
phpstan.neon Normal file
View file

@ -0,0 +1,7 @@
parameters:
level: 3
bootstrapFiles:
- .Build/vendor/autoload.php
scanDirectories:
- Classes
- Tests

BIN
tools/phpstan Executable file

Binary file not shown.