PHPackages                             inpsyde/wp-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. inpsyde/wp-stubs

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

inpsyde/wp-stubs
================

WordPress Stubs

2362.3k↓35.7%4PHPCI passing

Since Feb 29Pushed 7mo ago3 watchersCompare

[ Source](https://github.com/inpsyde/wp-stubs)[ Packagist](https://packagist.org/packages/inpsyde/wp-stubs)[ RSS](/packages/inpsyde-wp-stubs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (4)

WordPress stubs
===============

[](#wordpress-stubs)

This repo contains auto-generated WordPress stubs to be used with static analysis tools.

FAQ
---

[](#faq)

- Why this instead of "&lt; insert exiting project here &gt;"?

This project's purpose is:

- having multiple versions of WP in the same branch/version
- *not* having stubs for globals, but having stubs for constants
- having a super-simple "override" method. By declaring stubs in the [`fixtures.php` file](https://github.com/inpsyde/wp-stubs/blob/main/fixtures.php), it is possible to override the WordPress declaration for functions, classes, and interfaces. That way, it is easy to fix incorrect DocBlocks in WordPress and use "advanced" doc block supported by static analyzers (think of array shape, type aliases, conditional return types …)

How this works
==============

[](#how-this-works)

Every day, a GitHub Actions workflow calls the wp.org API to find new WordPress versions.

If it finds new versions, it generates and saves stubs for them (using ) while also updating the "latest" stub.

How to use
==========

[](#how-to-use)

The primary usage is for static analysis tools, for example, [Psalm](https://psalm.dev/):

Method 1: Get all WordPress versions
------------------------------------

[](#method-1-get-all-wordpress-versions)

### Steps:

[](#steps)

1. Require this project (`inpsyde/wp-stubs`) in your Composer's `"require-dev"` property
2. Create a `psalm.xml` config file (see [docs](https://psalm.dev/docs/running_psalm/configuration/))
3. In the Psalm configuration, add these lines: ```

    ```

You can replace `latest.php` with a specific WP version. See the available versions in the [`/stubs` directory](https://github.com/inpsyde/wp-stubs/tree/main/stubs).

**Note**: In that folder, a two-digit version number like `5.9` does not necessarily mean WordPress version `5.9`, but the *latest* in the `5.9.*` series. So if you use Composer to require WordPress and have a requirement like `5.9.*`, using the `stubs/5.9.php` stubs file will match the currently installed version.

The "stubs" folder contains stubs of many versions so that you can choose, but it would also be possible to have a CI script that loads different versions to test against different stubs.

However, the package size might get huge, and if not excluded from IDE's analysis, it might affect the IDE performance.

Method 2: Get a specific version
--------------------------------

[](#method-2-get-a-specific-version)

### Pre-requisite:

[](#pre-requisite)

In your `composer.json`, declare a [repository](https://getcomposer.org/doc/05-repositories.md#repository) like this:

```
{
  "repositories": [
    {
      "type": "composer",
      "url": "https://raw.githubusercontent.com/inpsyde/wp-stubs/main",
      "only": [
        "inpsyde/wp-stubs-versions"
      ]
    }
  ]
}
```

> **Note for Inpsyde developers**: The Inpsyde organization in [Private Packagist](https://packagist.com/) mirrors the above repository, so for Inpsyde's private repositories, this is likely not needed considering Private Packagist will probably be *already* added to the repo's `composer.json`.

### Steps:

[](#steps-1)

1. Require the "versioned" project in your Composer's `"require-dev"` property e.g. `{ "require": { "inpsyde/wp-stubs-versions": "dev-latest" } }`. *(Note how the package name has `-versions` appended)*
2. Create a `psalm.xml` config file ( see [docs](https://psalm.dev/docs/running_psalm/configuration/))
3. In the Psalm configuration, add these lines: ```

    ```

Using this approach, the latest version will be the *only* version Composer downloads.

Minimum requirements
--------------------

[](#minimum-requirements)

The code that generates the stubs requires PHP 8.0+. However, when consuming the package, there are no minimum requirements besides [being able to run WordPress](https://wordpress.org/about/requirements/).

Copyright and License
---------------------

[](#copyright-and-license)

Good news, this library is free for everyone! Since it's released under the MIT License you can use it free of charge on your personal or commercial website.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance44

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/003585053f7d5d2127d31d5a4e79ba309acc075154f5752de8f429ac42c54dbe?d=identicon)[Syde](/maintainers/Syde)

---

Top Contributors

[![inpsyde-deploybot](https://avatars.githubusercontent.com/u/12932151?v=4)](https://github.com/inpsyde-deploybot "inpsyde-deploybot (38 commits)")[![gmazzap](https://avatars.githubusercontent.com/u/2208282?v=4)](https://github.com/gmazzap "gmazzap (33 commits)")[![tfrommen](https://avatars.githubusercontent.com/u/6049306?v=4)](https://github.com/tfrommen "tfrommen (13 commits)")[![shvlv](https://avatars.githubusercontent.com/u/3157352?v=4)](https://github.com/shvlv "shvlv (6 commits)")[![tyrann0us](https://avatars.githubusercontent.com/u/8144115?v=4)](https://github.com/tyrann0us "tyrann0us (5 commits)")[![Chrico](https://avatars.githubusercontent.com/u/3417446?v=4)](https://github.com/Chrico "Chrico (3 commits)")[![widoz](https://avatars.githubusercontent.com/u/1917784?v=4)](https://github.com/widoz "widoz (1 commits)")[![meszarosrob](https://avatars.githubusercontent.com/u/6097856?v=4)](https://github.com/meszarosrob "meszarosrob (1 commits)")[![overclokk](https://avatars.githubusercontent.com/u/4604932?v=4)](https://github.com/overclokk "overclokk (1 commits)")[![AlexP11223](https://avatars.githubusercontent.com/u/5680466?v=4)](https://github.com/AlexP11223 "AlexP11223 (1 commits)")

---

Tags

hacktoberfestphp-stubsstatic-analysisstubswordpress

### Embed Badge

![Health badge](/badges/inpsyde-wp-stubs/health.svg)

```
[![Health](https://phpackages.com/badges/inpsyde-wp-stubs/health.svg)](https://phpackages.com/packages/inpsyde-wp-stubs)
```

###  Alternatives

[symfony/deepclone

Export any serializable PHP values as pure arrays - accelerator for Symfony's DeepCloner

141.1k](/packages/symfony-deepclone)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
