tenma / stubs
Stubs of Tenma's PHP API (Tenma::serve(), Tenma\Http, Tenma\Fs, ...) for IDEs and PHPStan
Requires
- php: >=8.5
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Stubs of Tenma's PHP API for IDEs and PHPStan.
Tenma embeds its PHP API (Tenma::serve(), Tenma::async(), Tenma\Http\Request, Tenma\Fs, ...) 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: pick up
tenma.phpfromvendor/, nothing else to do. -
PHPStan: with
phpstan/extension-installerthe package'sextension.neonis 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 there is no Tenma class. Code that runs under both checks with class_exists(Tenma::class).
Updating
tenma.php is generated, don't edit it. With a Tenma binary of the version you want:
tenma --stubs > tenma.php
License
MIT or Apache-2.0, at your option: LICENSE-MIT, LICENSE-APACHE.