Add extension template with PHPStan, PHPUnit and phpcs
This commit is contained in:
parent
b4c6581d4f
commit
8cd928caa9
22 changed files with 825 additions and 1 deletions
42
phpstan.neon.dist
Normal file
42
phpstan.neon.dist
Normal file
|
@ -0,0 +1,42 @@
|
|||
parameters:
|
||||
paths:
|
||||
- api
|
||||
- Civi
|
||||
- CRM
|
||||
- tests
|
||||
excludePaths:
|
||||
analyse:
|
||||
- CRM/*/DAO/*
|
||||
- tests/phpunit/bootstrap.php
|
||||
scanFiles:
|
||||
- twingle.civix.php
|
||||
- tools/phpunit/vendor/bin/.phpunit/phpunit/src/Framework/TestCase.php
|
||||
scanDirectories:
|
||||
- tools/phpunit/vendor/bin/.phpunit/phpunit/src/Framework
|
||||
bootstrapFiles:
|
||||
- tools/phpunit/vendor/bin/.phpunit/phpunit/vendor/autoload.php
|
||||
- vendor/autoload.php
|
||||
- phpstanBootstrap.php
|
||||
level: 9
|
||||
universalObjectCratesClasses:
|
||||
- Civi\Core\Event\GenericHookEvent
|
||||
checkTooWideReturnTypesInProtectedAndPublicMethods: true
|
||||
checkUninitializedProperties: true
|
||||
checkMissingCallableSignature: true
|
||||
treatPhpDocTypesAsCertain: false
|
||||
exceptions:
|
||||
check:
|
||||
missingCheckedExceptionInThrows: true
|
||||
tooWideThrowType: true
|
||||
checkedExceptionClasses:
|
||||
- \Webmozart\Assert\InvalidArgumentException
|
||||
implicitThrows: false
|
||||
ignoreErrors:
|
||||
# Note paths are prefixed with "*/" to work with inspections in PHPStorm because of:
|
||||
# https://youtrack.jetbrains.com/issue/WI-63891/PHPStan-ignoreErrors-configuration-isnt-working-with-inspections
|
||||
|
||||
# Example
|
||||
#- # Accessing results of API requests
|
||||
#message: "#^Offset '[^']+' does not exist on array[^\\|]+\\|null.$#"
|
||||
#path: */tests/phpunit/**/*Test.php
|
||||
tmpDir: .phpstan
|
Loading…
Add table
Add a link
Reference in a new issue