Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Phpstan Extension Ide Helper

Phpstan Extension Ide Helper Laravel Package

headercat/phpstan-extension-ide-helper

Provides dummy PHPStan namespace classes and functions so IDEs and autocompletion tools can reference PHPStan internals normally hidden inside its PHAR. Install as a dev dependency to get full autocompletion when writing PHPStan extensions.

View on GitHub
Deep Wiki
Context7

Provides dummy PHPStan namespace classes and functions so IDEs and autocompletion tools can resolve PHPStan internals. Because PHPStan ships as a PHAR, its code is normally invisible to editors—this package exposes stubs mirroring the official source, making extension development far less painful.

  • Auto-synced with phpstan/phpstan-src every 30 minutes
  • Supports any PHPStan version via * constraint
  • Includes stubs for classes, functions, and dependencies
  • Install as a dev-only Composer requirement
  • Lightweight—no runtime overhead, IDE use only
composer require --dev headercat/phpstan-extension-ide-helper
Frequently asked questions about Phpstan Extension Ide Helper
What is headercat/phpstan-extension-ide-helper used for?
It provides dummy PHPStan namespace classes and functions so your IDE can autocomplete and resolve symbols that live inside the PHPStan PHAR. PHPStan ships as a PHAR rather than plain PHP files, which means editors and autocompletion tools cannot normally read its internals. This package fills that gap for developers writing custom PHPStan rules, nodes, or extensions. It is not used for analysing application code and has no runtime effect.
How do I install headercat/phpstan-extension-ide-helper in a Laravel project?
Install it as a dev dependency with composer require --dev headercat/phpstan-extension-ide-helper. Alternatively add it manually to the require-dev block of your composer.json alongside phpstan/phpstan. Because it is dev-only tooling, it never ships to production and has no impact on your application's runtime dependencies. Commit the updated composer.json and lock file so the rest of the team gets identical stubs.
Does this package change anything at runtime or in production?
No. It is a dev-only package that only contains declaration-style dummy classes and functions for IDE consumption. Nothing is autoloaded during a production request, and it does not modify the analyser or your application code. Keep it in require-dev so it is excluded from production installs.
Which PHPStan version does this helper match?
Releases track upstream PHPStan versions, and release 2.3.1 mirrors the phpstan/phpstan-src 2.3.1 tag. The stubs are generated by scanning the phpstan/phpstan-src repository and appending an early return after each namespace declaration. Because of that tight coupling, you should keep the helper and PHPStan on the same minor version line.
Why do I need it when PHPStorm already understands the PHPStan PHAR?
PHPStorm handles PHAR stubs natively, so many users do not need this package at all. The helper is most useful in VSCode with Intelephense, or in any editor that cannot index PHAR contents, where you would otherwise need to configure explicit stub paths. It is also helpful in CI-adjacent tooling where the PHAR is not indexed.
How do I get IDE autocompletion working in VSCode or PHPStorm?
In VSCode with Intelephense, install the package as a dev dependency and point Intelephense at the generated stub directory via its stub path settings. PHPStorm generally resolves PHAR internals on its own, so the helper mainly adds convenience there. After upgrading the package, invalidate the IDE caches so stale or duplicate symbols do not linger, especially if PHPStan changed its PHAR structure.
Will these dummy stubs cause false positives or false negatives in PHPStan analysis?
The stubs are declaration-only dummies that inform your IDE, not the analyser. PHPStan still analyses your code against the real PHAR internals when you run phpstan analyse. Treat the helper purely as a developer-experience layer and always validate with an actual analysis run before merging. If a stub signature looks wrong, trust the analyser output, not the IDE hint.
What happens if the helper version drifts from my PHPStan version?
You can get phantom classes and misleading signatures, because the stubs would describe a different internal API than the PHAR you are actually running. Pin the pair to the same minor, for example phpstan/phpstan ^2.3 with headercat/phpstan-extension-ide-helper ^2.3, rather than floating unrelated carets. After any bump, re-verify hand-written @phpstan- type annotations and use statements that reference internal classes.
Is the package updated automatically when PHPStan releases a new version?
Yes, the maintainer runs a scheduled job roughly every 30 minutes that checks for new PHPStan releases and regenerates the stubs. If you need a release before the next scheduled run, you can comment on Issue #1 in the repository to trigger the job manually. Release notes are often terse, so inspect the version delta before upgrading.
Are there alternatives, and is the package still maintained?
Alternatives include PHPStorm's built-in PHAR support, manually configured Intelephense stub paths, or cloning phpstan/phpstan-src and generating your own stubs. This package automates that process and continues to publish releases tracking upstream PHPStan tags. Confirm that your PHPStan minor line is still published before adopting it, since a superseded release can force an upgrade.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route