Files
FreshRSS/phpstan.dist.neon
dependabot[bot] 226239d157 Bump phpstan/phpstan from 2.1.46 to 2.1.54 (#8753)
* Bump phpstan/phpstan from 2.1.46 to 2.1.54

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-version: 2.1.54
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixes some PHPStan issues, including compatibility PHP 8.2-
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/8713

Co-authored-by: Copilot <copilot@github.com>

* Bump PHPStan-strict-rules

* Fix PHPStan for PHP 8.3

* Ignore PHPStan warning for PHP 8.2 and PHP 8.3

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Copilot <copilot@github.com>
2026-05-02 21:16:27 +02:00

76 lines
2.0 KiB
Plaintext

parameters:
phpVersion:
min: 80100 # PHP 8.1
max: 80599 # PHP 8.5
level: 10 # https://phpstan.org/user-guide/rule-levels
fileExtensions:
- php
- phtml
paths:
- .
excludePaths:
analyse:
- lib/marienfressinaud/*
- lib/phpgt/*
- lib/phpmailer/*
- lib/simplepie/*
analyseAndScan:
- .git/*?
- extensions/node_modules?
- extensions/symbolic?
- extensions/vendor?
- node_modules/*?
- vendor/*
bootstrapFiles:
- cli/_cli.php
- lib/favicons.php
dynamicConstantNames:
- CACHE_PATH
- COPY_LOG_TO_SYSLOG
- COPY_SYSLOG_TO_STDERR
- DATA_PATH
- MAX_LOG_SIZE
- PUBLIC_RELATIVE
- SIMPLEPIE_SYSLOG_ENABLED
- STDERR
- STDOUT
- TMP_PATH
- USERS_PATH
checkBenevolentUnionTypes: true
checkImplicitMixed: true
checkMissingOverrideMethodAttribute: true
checkTooWideReturnTypesInProtectedAndPublicMethods: true
reportAnyTypeWideningInVarTag: true
reportPossiblyNonexistentConstantArrayOffset: true
treatPhpDocTypesAsCertain: false
strictRules:
disallowedEmpty: false
disallowedLooseComparison: false
disallowedShortTernary: false
strictArrayFilter: true
exceptions:
check:
missingCheckedExceptionInThrows: false # TODO pass maybe
tooWideThrowType: true
implicitThrows: false
checkedExceptionClasses:
- 'Minz_Exception'
ignoreErrors:
- '#Only booleans are allowed in (a negated boolean|a ternary operator condition|an elseif condition|an if condition|&&|\|\|), (bool|false|int(<[0-9, max]+>)?|true|null|\|)+ given.*#'
-
message: '#Access to deprecated#'
path: app/Models/Context.php
-
# For PHP 8.2 and PHP 8.3
identifier: function.alreadyNarrowedType
message: '#Call to function is_int\(\) with 1\d{3} will always evaluate to true\.#'
paths:
- lib/Minz/ModelPdo.php
- lib/Minz/PdoMysql.php
reportUnmatched: false
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon