Search by

tenma / stubs

Lento Leisenfeld

Stubs of Tenma's PHP API (Http\Server, Threading\Task, FileSystem, Data, ...) for IDEs and PHPStan

0.2.22 2026-10-31 19:22 UTC

README

Stubs of Tenma's PHP API for IDEs and PHPStan.

Tenma embeds its PHP API (Http\Server, Http\Request, Threading\Task, FileSystem\FileInfo, Data\Postgres, ...) in its binary, so IDEs and static analysis don't know it on their own. This package describes it: signatures and doc comments, empty bodies.

composer require --dev tenma/stubs
  • PhpStorm, Intelephense, PHP Tools: pick up src/ from vendor/, nothing else to do. One file per class, in folders by namespace.

  • PHPStan: with phpstan/extension-installer the package's extension.neon is included automatically. Without it:

    includes:
        - vendor/tenma/stubs/extension.neon

The stubs are never autoloaded, so nothing changes at runtime: under Tenma the real classes are there, under FPM they are missing. Code that runs under both checks with class_exists(\Http\Server::class, false).

Updating

src/ is generated, don't edit it. Every Tenma release regenerates it. By hand, with a Tenma binary of the version you want:

rm -rf src && tenma --stubs src

License

MIT or Apache-2.0, at your option: LICENSE-MIT, LICENSE-APACHE.