承接 miguelcolmenares/cf7-stubs 相关项目开发

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

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

miguelcolmenares/cf7-stubs

Composer 安装命令:

composer require miguelcolmenares/cf7-stubs

包简介

Contact Form 7 function and class declaration stubs for static analysis

README 文档

README

Packagist License

Provides stub declarations for Contact Form 7 functions, classes, interfaces, and traits. These stubs can help plugin and theme developers leverage static analysis tools like PHPStan and Psalm.

The package includes two files:

  • contact-form-7-stubs.php - Auto-generated stubs from Contact Form 7 source code
  • contact-form-7-types.php - Additional constants and type definitions

Note: The auto-generated stubs may have some PHPStan errors due to missing type hints in the original CF7 code. Including contact-form-7-types.php helps reduce these errors by providing essential constants like MB_IN_BYTES.

Current version: Contact Form 7 6.1.3

Stubs include:

  • 308 functions
  • 66 classes
  • 8 traits
  • 0 interfaces

The stubs are generated directly from the Contact Form 7 plugin source code using php-stubs/generator.

Requirements

  • PHP 7.4 or 8.0+

Installation

Require this package as a development dependency with Composer.

composer require --dev miguelcolmenares/cf7-stubs

Alternatively you may download contact-form-7-stubs.php directly.

Usage with PHPStan

composer require --dev szepeviktor/phpstan-wordpress

The package szepeviktor/phpstan-wordpress depends on phpstan/phpstan and WordPress stubs. Then include the Contact Form 7 stubs in your PHPStan configuration:

# phpstan.neon.dist
parameters:
    bootstrapFiles:
        - vendor/miguelcolmenares/cf7-stubs/contact-form-7-stubs.php
        - vendor/miguelcolmenares/cf7-stubs/contact-form-7-types.php

Note: Make sure WordPress stubs are loaded before Contact Form 7 stubs, as CF7 depends on WordPress classes. The contact-form-7-types.php file provides additional type annotations that improve static analysis accuracy.

Usage with Psalm

Update your Psalm config to include this section:

<stubs>
    <file name="vendor/miguelcolmenares/cf7-stubs/contact-form-7-stubs.php" />
</stubs>

Furthermore, ensure Contact Form 7 plugin files are not included in <projectFiles>.

Usage in Intellisense

If your IDE has trouble parsing Contact Form 7, you may find the stubs useful for enabling code completion and related features. For example, there are instructions for usage with VSCode's Intelephense extension.

Versioning

This package is versioned to match the Contact Form 7 version from which the stubs are generated.

Generating stubs for a different Contact Form 7 version

  1. Run a modern PHP version (7.4+)

  2. Clone this repository and cd into it

  3. Update the version in source/composer.json:

    "contact-form-7/contact-form-7": "x.x.x"

    And update the download URL:

    "url": "https://downloads.wordpress.org/plugin/contact-form-7.x.x.x.zip"
  4. Run composer update in the source directory (or delete source/contact-form-7 to force re-download)

  5. Run ./generate.sh from the root directory

The contact-form-7-stubs.php file should now be updated.

Trademark Notice

"Contact Form 7" is a trademark of Rock Lobster, LLC. This project is not affiliated with, endorsed by, or sponsored by Rock Lobster, LLC or the Contact Form 7 project. This is an independent tool created to provide static analysis support for developers using the Contact Form 7 plugin.

For more information, see the Contact Form 7 Trademark Policy.

License

MIT

miguelcolmenares/cf7-stubs 适用场景与选型建议

miguelcolmenares/cf7-stubs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.85k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「wordpress」 「stubs」 「definitions」 「static-analysis」 「PHPStan」 「contact-form-7」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 miguelcolmenares/cf7-stubs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 miguelcolmenares/cf7-stubs 我们能提供哪些服务?
定制开发 / 二次开发

基于 miguelcolmenares/cf7-stubs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 31
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-17