Download the PHP package miguelcolmenares/cf7-stubs without Composer

On this page you can find all versions of the php package miguelcolmenares/cf7-stubs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cf7-stubs

Contact Form 7 Stubs

Packagist

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:

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:

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

Requirements

Installation

Require this package as a development dependency with Composer.

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

Usage with PHPStan

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

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:

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:

    And update the download URL:

  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


All versions of cf7-stubs with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package miguelcolmenares/cf7-stubs contains the following files

Loading the files please wait ...