Линтеры

This commit is contained in:
2025-12-09 11:31:04 +08:00
parent ffaed2b657
commit 5c1b19c08a
8 changed files with 6003 additions and 186 deletions

48
phpstan.neon Normal file
View File

@@ -0,0 +1,48 @@
includes:
- ./vendor/phpstan/phpstan-mockery/extension.neon
parameters:
# https://phpstan.org/config-reference
level: 8
polluteScopeWithLoopInitialAssignments: true
polluteScopeWithAlwaysIterableForeach: true
# polluteScopeWithBlock: true # v2+
checkExplicitMixedMissingReturn: true
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
reportMaybesInMethodSignatures: false # при true перегиб для объявленных в интерфейсах шаблонов
reportMaybesInPropertyPhpDocTypes: false # при true перегиб для объявленных в интерфейсах шаблонов
reportStaticMethodSignatures: true
checkTooWideReturnTypesInProtectedAndPublicMethods: false
checkUninitializedProperties: false
checkDynamicProperties: false
rememberPossiblyImpureFunctionValues: true
# checkBenevolentUnionTypes: true # перегиб для union-types
reportPossiblyNonexistentGeneralArrayOffset: false
reportPossiblyNonexistentConstantArrayOffset: false
reportAlwaysTrueInLastCondition: true
reportWrongPhpDocTypeInVarTag: true
reportAnyTypeWideningInVarTag: true
checkMissingOverrideMethodAttribute: true
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
checkMissingCallableSignature: true
parallel:
jobSize: 5
maximumNumberOfProcesses: 16
minimumNumberOfJobsPerProcess: 1
paths:
- app/
- config/
- public/index.php
excludePaths:
- cache/
- views/
- vendor/
ignoreErrors:
# https://phpstan.org/user-guide/ignoring-errors
# https://phpstan.org/error-identifiers
# требует явно расписывать все итерируемые типы, структуры полей и т.д.
# можно раскомментировать для уточнения типов при разработке, но убирать пока рано
# - identifier: missingType.iterableValue