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

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

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

apermo/phpstan-wordpress-rules

最新稳定版本:v0.3.0

Composer 安装命令:

composer require apermo/phpstan-wordpress-rules

包简介

Custom PHPStan rules for WordPress projects by Apermo.

README 文档

README

CI codecov License: MIT

Custom PHPStan rules for WordPress projects. Provides a unified static analysis configuration and custom rules across all Apermo projects.

Requirements

  • PHP 8.1+
  • PHPStan 2.0+

Installation

composer require --dev apermo/phpstan-wordpress-rules

If you use phpstan/extension-installer, the rules are registered automatically.

Manual Registration

Add to your phpstan.neon:

includes:
    - vendor/apermo/phpstan-wordpress-rules/rules.neon

What's Included

Bundled Extensions

This package automatically includes:

Custom Rules

Rule Category What it detects
DisallowQueryPostsRule wp-api query_posts() usage
PostTypeNameLengthRule wp-api register_post_type() name > 20 chars
TaxonomyNameLengthRule wp-api register_taxonomy() name > 32 chars
TransientExpirationRule wp-api set_transient() without expiration
RemoteRequestTimeoutRule wp-api wp_remote_* without explicit timeout
PreSerializedDataRule data-integrity Pre-serialized data in WP storage functions
PreEncodedJsonDataRule data-integrity Pre-encoded JSON in WP storage functions
NoDynamicCodeExecutionRule security create_function(), assert() with string, preg_replace() with /e
NoEvalRule security eval() usage
UnsafeUnserializeRule security unserialize() without allowed_classes
NoHtmlDomParsingRule code-quality DOMDocument::loadHTML, tidy functions, Masterminds\HTML5
NoConcatenationInTranslationRule i18n String concatenation inside __(), _e(), etc.
NoBlanketSuppressionRule code-quality phpcs:disable/phpcs:ignore/@phpstan-ignore without specific rules

Development

Setup

composer install

Running Tests

composer test

Static Analysis

composer analyse

Coding Standards

composer cs

License

MIT — see LICENSE for details.

统计信息

  • 总下载量: 663
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固