tarantool/stubs
IDE stub definitions for the Tarantool PHP extension, providing accurate autocompletion, type hints, and static analysis for Tarantool classes and functions in Laravel or plain PHP projects.
What the artifact actually is. tarantool/stubs is not a runtime library — it is a declaration-only package (class/function/constant signatures with empty bodies) whose only consumers are IDEs (PhpStorm, Intelephense) and static analyzers (PHPStan, Psalm). It exists because the Tarantool PHP connector is delivered as a C extension (PECL tarantool) whose symbols are invisible to reflection-based tooling on machines where the extension is not built, which is the normal state of a Laravel developer's laptop and of most CI runners.
Architecture fit. Essentially zero coupling: no autoloaded production classes, no service provider, no config, no framework hooks. It is a require-dev artifact that sits alongside phpstan/phpstan or vimeo/psalm in any Laravel codebase. There is no architectural conflict with Laravel's conventions because nothing ships to production.
Integration feasibility. High, with one non-obvious wiring constraint. Stubs must be registered as analysis-only inputs — PHPStan's stubFiles/scanFiles, Psalm's <stubs>, or an IDE include path — and must not be added to Composer's files/autoload for runtime, or the class declarations will collide with the real extension and produce Cannot redeclare class fatals. Done correctly, this is a one-file config change.
Technical risk.
tarantool/client, the stubs are redundant — that client ships real classes with docblocks that IDEs and analyzers resolve natively. This should be resolved before anything else.Key questions.
tarantool extension or pure-PHP tarantool/client? If the latter, this package is a no-op.require-dev addition acceptable in the shared platform template, or must this be vendored internally?Stack fit. Add to composer.json under require-dev; excluded automatically from composer install --no-dev production builds. Register in phpstan.neon (stubFiles: or scanFiles:) and/or psalm.xml (<stubs>). For PhpStorm, mark the vendor path as included but excluded from indexing-as-source, or rely on the Composer resolution. No Laravel config, no .env, no container bindings.
Migration path. Pilot in a single service that already talks to Tarantool. Capture a PHPStan baseline before and after; the delta is the measurable value (previously-unresolved calls to extension classes now type-checked). If the delta is real, promote the config snippet to the internal Laravel service template; if not, drop it and document why.
Compatibility. Two hard constraints: (a) stub files must parse under every PHP version in the matrix — stubs sometimes use newer syntax than the floor version; (b) the stubs must not shadow the extension on runners where the extension is actually installed. Prefer real extension reflection over stubs whenever extension_loaded('tarantool') is true.
Sequencing.
dev-master.require-dev + static analysis config on one service.ReflectionExtension('tarantool') signatures against the stub declarations and fail on mismatch.Maintenance. Upstream lives in the official Tarantool org but is a low-traffic artifact with no evident release cadence. Assume it will lag new extension releases. We own the drift check that compensates for this; without it the stubs silently rot into a liability.
Support. Community-only, no SLA, no vendor escalation. The mitigation is size: the package is small enough to fork and patch internally at negligible cost if it is abandoned or wrong, which is why internal vendoring is a credible fallback rather than a project.
Scaling. Effectively free at runtime — no memory, no boot cost, no autoload pressure in production. The only scaling dimension is CI minutes and the number of repos that carry the config; standardize the snippet so this does not get re-litigated per service.
Failure modes.
Call to undefined method in production that analysis explicitly blessed.Cannot redeclare class at boot, typically only in environments where the extension is installed (i.e., staging/prod, not dev) — a classic late-detection failure.--no-scripts/--no-plugins in CI.Ramp-up. Hours, not days, for anyone comfortable with PHPStan/Psalm configuration. Budget roughly half a day to include the drift check and runbook entry. The dominant cost is not the tooling — it is the diligence of pinning and verifying against the deployed extension version, which is a process obligation rather than a technical one.
How can I help you explore Laravel packages today?