php-stubs/genesis-stubs

用于静态分析的 Genesis 函数存根。

v3.4.0 2022-10-01 23:15 UTC

This package is auto-updated.

Last update: 2024-08-29 05:55:49 UTC


README

Build Status

此包为 Genesis 框架 的函数、类和接口提供存根声明。这些存根可以帮助插件和主题开发者利用静态分析工具,如 PHPStan,因为它无法解析 Genesis,因为 Genesis 不是一个干净的 OOP 代码。

存根直接从最新版本的 Genesis 生成,该版本需要手动下载,因为它被表单阻止。使用 giacocorsiglia/stubs-generator

要求

  • PHP >=7.1

安装

使用 Composer 将此包作为开发依赖项要求。

composer require --dev php-stubs/genesis-stubs

或者,您可以直接下载 genesis-stubs.php

在 PHPStan 中的使用

在 PHPStan 配置文件中包含所有存根。

parameters:
    bootstrapFiles:
        - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
        - %rootDir%/../../php-stubs/genesis-stubs/genesis-stubs.php