mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-10 03:36:12 +01:00
[FEATURE] Add type checking via PHPStan (#218)
This commit is contained in:
parent
fc1b690294
commit
db1080b119
8 changed files with 26 additions and 0 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -14,4 +14,5 @@
|
||||||
/codeception.yml export-ignore
|
/codeception.yml export-ignore
|
||||||
/phive.xml
|
/phive.xml
|
||||||
/phpcs.xml export-ignore
|
/phpcs.xml export-ignore
|
||||||
|
/phpstan.neon export-ignore
|
||||||
/tools/ export-ignore binary
|
/tools/ export-ignore binary
|
||||||
|
|
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
|
@ -63,6 +63,7 @@ jobs:
|
||||||
- "php:sniff"
|
- "php:sniff"
|
||||||
- "php:codestyle"
|
- "php:codestyle"
|
||||||
- "php:copypaste"
|
- "php:copypaste"
|
||||||
|
- "php:stan"
|
||||||
- "composer:normalize"
|
- "composer:normalize"
|
||||||
php-version:
|
php-version:
|
||||||
- 7.4
|
- 7.4
|
||||||
|
|
|
@ -298,6 +298,17 @@ php-copypaste-check:
|
||||||
script:
|
script:
|
||||||
- composer ci:php:copypaste
|
- 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:
|
composer-normalize:
|
||||||
extends: .default
|
extends: .default
|
||||||
stage: codestyle
|
stage: codestyle
|
||||||
|
|
|
@ -37,6 +37,10 @@ All of those checks are available in Github Actions and in Gitlab CI.
|
||||||
|
|
||||||
`composer ci:php:copypaste`
|
`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)
|
### JSON Lint check by [jsonlint](https://github.com/Seldaek/jsonlint)
|
||||||
|
|
||||||
`composer ci:json:lint`
|
`composer ci:json:lint`
|
||||||
|
|
|
@ -89,6 +89,7 @@
|
||||||
"ci:php:copypaste": "php ./tools/phpcpd Classes Configuration Tests",
|
"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: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:sniff": "php ./tools/phpcs Classes Configuration Tests",
|
||||||
|
"ci:php:stan": "php ./tools/phpstan analyse Classes",
|
||||||
"ci:static": [
|
"ci:static": [
|
||||||
"@ci:php:lint",
|
"@ci:php:lint",
|
||||||
"@ci:php:sniff",
|
"@ci:php:sniff",
|
||||||
|
|
|
@ -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="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="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="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>
|
</phive>
|
||||||
|
|
7
phpstan.neon
Normal file
7
phpstan.neon
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
parameters:
|
||||||
|
level: 3
|
||||||
|
bootstrapFiles:
|
||||||
|
- .Build/vendor/autoload.php
|
||||||
|
scanDirectories:
|
||||||
|
- Classes
|
||||||
|
- Tests
|
BIN
tools/phpstan
Executable file
BIN
tools/phpstan
Executable file
Binary file not shown.
Loading…
Reference in a new issue