kwn/php-rdkafka-stubs
IDE helper stubs for php-rdkafka (librdkafka) extension. Adds classes, methods and constants for Kafka producers/consumers to improve autocompletion and static analysis in PHP projects without requiring the extension at dev time.
php-rdkafka extension, enabling autocompletion, type hints, and static analysis in IDEs (PhpStorm, VSCode, etc.). It does not modify runtime behavior but enhances developer experience.php-rdkafka usage.php-rdkafka extension (not included; must be installed separately via PECL).php-rdkafka—validate against your target version.php-rdkafka version.php-rdkafka errors (e.g., misconfigured brokers) will still occur.php-rdkafka updates (monitor release cadence).stubs directory setup).php-rdkafka is updated, stubs must align—automate version checks in CI/CD.php-rdkafka that stubs won’t address?composer validate)?php-rdkafka docs or custom PHPDoc annotations suffice?php-rdkafka changes? (Fork if needed.)stubs in composer.json).level: 5 or strict modes to leverage stubs.php-rdkafka (install via PECL or system package manager).php-rdkafka may drop PHP 7.4 support).php-rdkafka extension:
pecl install rdkafka
php.ini and restart PHP-FPM/Nginx.composer.json:
"repositories": [
{ "type": "vcs", "url": "https://github.com/kwn/php-rdkafka-stubs" }
],
"require": {
"kwn/php-rdkafka-stubs": "^1.0"
}
composer update.File > Settings > PHP > Stub Files.php-ide extension is configured to use stubs.RdKafka\Consumer, RdKafka\Producer, etc.phpstan/psalm to confirm stubs are recognized.php-rdkafka version (per description), but test thoroughly.spatie/laravel-kafka), check their php-rdkafka version requirements.php-rdkafka wrappers exist (resolve via aliases).php-rdkafka and verify basic Kafka operations work.composer validate).php-rdkafka releases and update stubs proactively (or fork if upstream lags).composer.json with ^ or ~ constraints to auto-update."kwn/php-rdkafka-stubs": "~1.0"
createTopic() showing?")..idea/exclude or VSCode exclude settings).| Failure Scenario | Impact | Mitigation |
|---|---|---|
Stubs lag behind php-rdkafka |
Broken autocompletion | Fork and maintain stubs if needed. |
php-rdkafka extension fails |
Runtime errors (stubs unaffected) | Monitor Kafka broker health separately. |
| IDE misconfiguration | Stubs ignored | Document setup steps in README. |
| CI/CD stub validation fails | Blocked merges | Auto-fix stub versions in PR templates. |
produce(), consume()).How can I help you explore Laravel packages today?