web/config/phpstan/phpstan.neon

52 lines
1.6 KiB
Text

# This is the config file for PHPStan when run from the command line.
includes:
- ../../vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
parameters:
level: 9
ignoreErrors:
# Ignore errors caused by `Template` static class reflection.
- '#Call to an undefined static method Template::[a-zA-Z0-9\\_]+\(\)\.#'
bootstrapFiles:
- %rootDir%/../../../lib/Constants.php
paths:
- %rootDir%/../../../lib
- %rootDir%/../../../www
- %rootDir%/../../../scripts
- %rootDir%/../../../scripts/generate-feeds
- %rootDir%/../../../scripts/generate-bulk-downloads
- %rootDir%/../../../scripts/ingest-fa-payments
- %rootDir%/../../../scripts/inject-chapter-navigation-footer
- %rootDir%/../../../scripts/pending-payments-watchdog
- %rootDir%/../../../scripts/process-pending-payments
- %rootDir%/../../../scripts/update-ebook-database
- %rootDir%/../../../scripts/update-patrons-circle
- %rootDir%/../../../scripts/update-project-statuses
- %rootDir%/../../../templates
dynamicConstantNames:
- SITE_STATUS
- DONATION_DRIVES_ENABLED
- DONATION_DRIVE_COUNTER_ENABLED
exceptions:
# PHPStan only uses PHPDocs to compute exception bubbling; without this line, PHPStan assumes that any function without a `@throws` doc throws any number of exceptions, instead of no exceptions.
implicitThrows: false
check:
missingCheckedExceptionInThrows: true
tooWideThrowType: true
uncheckedExceptionRegexes:
- '#^Safe\\#'
uncheckedExceptionClasses:
- 'Exceptions\DatabaseQueryException'
- 'Exceptions\MultiSelectMethodNotFoundException'
- 'PDOException'
- 'TypeError'
- 'ValueError'