承接 vix/phpstan-rules 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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.

Tests PHPStan PHP Version License: MIT

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.

  • main is aliased to 0.1.x-dev until 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.1 once v0.1.0 is 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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固