openswoole/ide-helper
Generates IDE helper stubs for OpenSwoole, improving autocompletion, type hints, and static analysis in PhpStorm and other editors. Useful for Swoole-style async/server apps to navigate APIs faster and reduce guesswork.
.phpstorm.meta.php or VSCode stub files, which may require manual configuration or maintenance for complex projects.composer require openswoole/ide-helper) and IDE configuration (e.g., VSCode’s php.suggest.stubs) is straightforward.openswoole/openswoole).Swoole\Table or Swoole\Server) might not be fully reflected in static stubs, leading to false negatives in IDE hints.optimize:clear or config:cache?laravel/ide-helper) may offer broader coverage.config.php version aligns.openswoole/openswoole:^4.8). Version mismatches may cause IDE errors.Swoole\Server, Swoole\Coroutine).composer require openswoole/ide-helper --dev
composer.json under require-dev to exclude from production.// .vscode/settings.json
{
"php.suggest.stubs": [
"vendor/openswoole/ide-helper/stubs/*.php"
]
}
File > Settings > Languages & Frameworks > PHP > Stub Files.vendor/openswoole/ide-helper/stubs/ to the list.new \Swoole\Server(...)).barryvdh/laravel-ide-helper if both generate stubs. Prioritize one or merge stub paths.OpenSwoole\Laravel\ServiceProvider) are registered before IDE helper generation.npm run dev.Server, Table, Coroutine).composer update openswoole/ide-helper to pull latest stubs.stubs/ and reference them in IDE settings.mkdir -p stubs/openswoole
cp vendor/openswoole/ide-helper/stubs/*.php stubs/openswoole/
.vscode/ or .phpstorm.meta.php template in the repo to standardize setup.composer.json).php -r "var_dump(class_exists('\Swoole\Server'));" to verify class loading.husky):
# .husky/pre-commit
npx lint-staged --config=.husky/lint-staged-config.js
// .husky/lint-staged-config.js
module.exports = {
"*.php": () => "test -f .vscode/settings.json"
};
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Stub version mismatch | IDE shows incorrect/missing hints | Pin OpenSwoole version in composer.json |
| IDE misconfiguration | No autocompletion for OpenSwoole | Provide team-wide IDE setup docs |
| Custom OpenSwoole classes missing | False negatives in dynamic code | Maintain project-specific stubs |
| IDE plugin conflicts | Stub parsing errors | Disable conflicting plugins temporarily |
| CI |
How can I help you explore Laravel packages today?