PHPackages                             mralaminahamed/divi-theme-stubs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mralaminahamed/divi-theme-stubs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mralaminahamed/divi-theme-stubs
===============================

Divi theme function and class declaration stubs for static analysis and IDE completion.

v5.7.4(today)02↑2900%MITShellPHP &gt;=7.4

Since Feb 16Pushed today1 watchersCompare

[ Source](https://github.com/mralaminahamed/phpstan-divi-theme-stubs)[ Packagist](https://packagist.org/packages/mralaminahamed/divi-theme-stubs)[ Docs](https://github.com/mralaminahamed/phpstan-divi-theme-stubs)[ GitHub Sponsors](https://github.com/sponsors/mralaminahamed)[ RSS](/packages/mralaminahamed-divi-theme-stubs/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (9)Used By (0)

Divi Theme Stubs
================

[](#divi-theme-stubs)

[![Latest Version](https://camo.githubusercontent.com/04f8550b882ab758520afeff3c530b749a5f63b6a9d8202d705899e0df1a03c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d72616c616d696e6168616d65642f646976692d7468656d652d73747562732e7376673f636f6c6f723d344343363145267374796c653d666c61742d737175617265)](https://packagist.org/packages/mralaminahamed/divi-theme-stubs)[![Downloads](https://camo.githubusercontent.com/f37972f6d1bd97e9cfd794f65260601dc3513a020c524495ef1487baa1859a3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d72616c616d696e6168616d65642f646976692d7468656d652d73747562732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mralaminahamed/divi-theme-stubs/stats)[![License](https://camo.githubusercontent.com/26db34cf9a78af5b7b5d806cbe464332ac6f7624d52e24faf4056f34afbceb01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d72616c616d696e6168616d65642f646976692d7468656d652d73747562732e7376673f7374796c653d666c61742d737175617265)](./LICENSE)[![PHP Version](https://camo.githubusercontent.com/a61da20206753444944cd3f052b29646dbe6340412eb695c4b343ca3febc20d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d72616c616d696e6168616d65642f646976692d7468656d652d73747562732e7376673f7374796c653d666c61742d737175617265)](./composer.json)[![Tweet](https://camo.githubusercontent.com/7cc5e693bda53368a3427bda35ecf05dabe406c7ee29071de798d475dc2c8775/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54776565742d73686172652d3164613166323f7374796c653d666c61742d737175617265266c6f676f3d74776974746572)](https://twitter.com/intent/tweet?text=Check%20out%20Divi%20Theme%20Stubs%20for%20IDE%20completion%20and%20static%20analysis%20https%3A%2F%2Fgithub.com%2Fmralaminahamed%2Fphpstan-divi-theme-stubs)

PHP stub declarations for the [Divi Theme](https://elegantthemes.com/gallery/divi) to enhance IDE completion and static analysis capabilities. Generated using [php-stubs/generator](https://github.com/php-stubs/generator) directly from the source code.

🚀 Features
----------

[](#-features)

- Complete function, class, and interface declarations
- Constant definitions for proper static analysis
- IDE autocompletion support
- PHPStan integration
- Regular updates with latest Divi theme versions
- Excludes unnecessary files (widgets, WooCommerce integrations, etc.)
- Support for both manual installation and Composer

📋 Requirements
--------------

[](#-requirements)

- PHP &gt;= 7.4
- Composer for dependency management
- Git for version control
- Valid Elegant Themes account credentials (for development)

📦 Installation
--------------

[](#-installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
# Install as a development dependency
composer require --dev mralaminahamed/divi-theme-stubs

# Or specify a version
composer require --dev mralaminahamed/divi-theme-stubs:^4.0
```

### Manual Installation

[](#manual-installation)

Download the stub files directly:

- [divi-theme-stubs.stub](https://raw.githubusercontent.com/mralaminahamed/phpstan-divi-theme-stubs/main/divi-theme-stubs.stub)
- [divi-theme-constants-stubs.stub](https://raw.githubusercontent.com/mralaminahamed/phpstan-divi-theme-stubs/main/divi-theme-constants-stubs.stub)

🔧 Configuration
---------------

[](#-configuration)

### PHPStan Integration

[](#phpstan-integration)

Add the stubs to your `phpstan.neon` configuration:

```
parameters:
    bootstrapFiles:
        - vendor/mralaminahamed/divi-theme-stubs/divi-theme-constants-stubs.stub
        - vendor/mralaminahamed/divi-theme-stubs/divi-theme-stubs.stub
```

### IDE Configuration

[](#ide-configuration)

#### PhpStorm

[](#phpstorm)

1. Go to `Settings` → `PHP` → `Include Path`
2. Add the directory containing the stub files

#### VS Code with Intelephense

[](#vs-code-with-intelephense)

Add to your `.vscode/settings.json`:

```
{
    "intelephense.stubs": [
        "wordpress",
        "divi-theme-stubs"
    ]
}
```

#### VS Code with PHP Intellisense

[](#vs-code-with-php-intellisense)

Add to your `settings.json`:

```
{
    "php.stubs": [
        "vendor/mralaminahamed/divi-theme-stubs/divi-theme-stubs.stub",
        "vendor/mralaminahamed/divi-theme-stubs/divi-theme-constants-stubs.stub"
    ]
}
```

🔍 Usage Example
---------------

[](#-usage-example)

```
