承接 mralaminahamed/divi-theme-stubs 相关项目开发

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

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

mralaminahamed/divi-theme-stubs

Composer 安装命令:

composer require --dev mralaminahamed/divi-theme-stubs

包简介

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

README 文档

README

Latest Version Downloads License PHP Version Tweet

PHP stub declarations for the Divi Theme to enhance IDE completion and static analysis capabilities. Generated using php-stubs/generator directly from the source code.

🚀 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

  • PHP >= 7.4
  • Composer for dependency management
  • Git for version control
  • Valid Elegant Themes account credentials (for development)

📦 Installation

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

Download the stub files directly:

🔧 Configuration

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

PhpStorm

  1. Go to SettingsPHPInclude Path
  2. Add the directory containing the stub files

VS Code with Intelephense

Add to your .vscode/settings.json:

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

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

<?php

// Your code will now have full IDE support
use ET_Builder_Module;

class MyCustomModule extends ET_Builder_Module {
    public function init() {
        $this->name = 'Custom Module';
        $this->slug = 'custom_module';
        // IDE will provide proper autocompletion for all properties
    }
}

// Constants are properly defined
if (defined('ET_BUILDER_VERSION')) {
    // Your implementation
}

🛠 Development

Setting Up Development Environment

  1. Clone the repository:
git clone https://github.com/mralaminahamed/phpstan-divi-theme-stubs.git
cd phpstan-divi-theme-stubs
  1. Install dependencies:
composer install
  1. Configure authentication:
# Add to your ~/.bashrc or ~/.zshrc
export ET_USERNAME='your_elegant_themes_username'
export ET_API_KEY='your_elegant_themes_api_key'

Available Commands

# Generate stubs
composer generate

# Release new version
composer release

# Release only latest version
composer release:latest

# Clean up generated files
composer cleanup

# Run all checks
composer check

# Run static analysis
composer analyze

# Run coding standards check
composer cs

Directory Structure

.
├── bin/
│   ├── generate.sh
│   └── release.sh
├── configs/
│   └── finder.php
├── lib/
│   └── shared.sh
├── source/
├── tests/
├── composer.json
└── README.md

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow PSR-12 coding standards
  • Add/update tests for new features
  • Update documentation for significant changes
  • Verify stub generation works for latest Divi version

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

💬 Support

⚠️ Known Issues and Limitations

  • Some dynamic properties and methods may not be properly stubbed
  • WooCommerce integration stubs are excluded by default
  • Custom module properties need to be explicitly declared

📝 Changelog

See CHANGELOG.md for all notable changes.

Made with ❤️ by Mr Alamin Ahamed

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固