vix/phpstan-rules
Composer 安装命令:
composer require --dev vix/phpstan-rules
包简介
PHPStan rules package with framework-specific rule sets
README 文档
README
PHPStan rules package with framework-specific rule sets.
Setup
Install as a development dependency:
composer require --dev vix/phpstan-rules
Include extension config in PHPStan config:
includes: - vendor/vix/phpstan-rules/extension.neon
When phpstan/extension-installer is installed, extension.neon is loaded automatically.
Enable all currently available rules:
parameters: vixPhpstan: php: rules: all: true yii2: rules: all: true
Or enable selected rules:
parameters: vixPhpstan: php: rules: remoteFileGetContents: true disabledSslVerification: true yii2: rules: missingAccessRule: true missingVerbFilterRule: true queryOneWithoutLimit: true
Current config from extension.neon:
parameters: vixPhpstan: php: rules: all: false disabledSslVerification: false httpClientWithoutTimeout: false remoteFileGetContents: false yii2: rules: activeDataProviderWithoutPagination: false all: false componentInitParentCall: false controllerBeforeActionParentResultIgnored: false csrfDisabledWithoutCompensatingControl: false deleteAllOrUpdateAllWithoutWhere: false fileValidatorTooLoose: false imageValidatorTooLoose: false lifecycleParentCall: false lifecycleSelfSave: false massSelectionWithoutLimit: false missingAccessRule: false missingAjaxFilterRule: false missingVerbFilterRule: false mixedResponseTypesInAction: false mutatingActionAllowsGet: false nPlusOneRelationInLoop: false nativeHeaderInController: false responseStatusCodeAssignmentInController: false publicAllowWithoutConstraint: false queryOneWithoutLimit: false queryPerformanceSmell: false rawSqlConditionWithVariable: false redirectReferrerWithoutFallback: false responseFormatAssignmentInController: false saveFalseWithoutReason: false scenarioAssignedAfterLoad: false sensitiveAttributeMarkedSafe: false transactionWithoutRollbackHandling: false unboundedQueryResult: false unknownActionInBehavior: false webControllerOnlyActions: false allowedSaveFalseNamespaces: [] sensitiveAttributePatterns: - '~^(id|user_id|created_at|updated_at|created_by|updated_by|role|status|...|is_admin)$~i'
Override example:
parameters: vixPhpstan: yii2: allowedSaveFalseNamespaces: - app\migrations
Versioning
This package follows Semantic Versioning.
mainis aliased to0.1.x-devuntil the first stable release line moves forward.- The first stable tag for this package should be
v0.1.0. - Stable installs should use a constraint such as
^0.1oncev0.1.0is tagged. - Before the first stable tag exists, use the development constraint
0.1.x-dev.
Example constraints:
composer require --dev vix/phpstan-rules:^0.1 composer require --dev vix/phpstan-rules:0.1.x-dev
Rules
Detailed rule descriptions, before/after examples, and rule-specific parameters are documented in docs/RULES.md.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-18