jetbrains/phpstorm-attributes
JetBrains PhpStorm Attributes for PHP 8+: add IDE-only attributes like Deprecated, ArrayShape, ObjectShape, and Immutable to improve code completion and static analysis. Bundled with PhpStorm 2020.3+, optional composer dev dependency to avoid “Class not found” in other tools.
Architecture fit: Purely dev-time dependency with zero runtime impact. Integrates natively with PhpStorm's static analysis engine without altering application architecture or dependencies. Works seamlessly with PHP 8+ projects and Laravel's existing toolchain.
Integration feasibility: Extremely low effort. Single composer require --dev command suffices. No code refactoring needed beyond applying attributes to relevant code elements. Fully compatible with Composer-based workflows and IDE-driven development.
Technical risk: Minimal. No runtime dependencies or conflicts. Primary risks are developer misapplication (e.g., incorrect ArrayShape definitions causing false IDE warnings) and potential IDE version mismatches if team uses outdated PhpStorm versions. No security implications.
Key questions: How do static analysis tools (Psalm/PHPStan) integrate with these attributes? What's the process for ensuring consistent PhpStorm versioning across teams? Are there edge cases where attributes might conflict with other PHP 8 features like attributes in metadata?
Stack fit: Requires PHP 8.0+ (for attribute syntax), PhpStorm 2020.3+, and Composer. Fully compatible with Laravel projects as a dev-only dependency. No production stack impact or configuration changes needed.
Migration path: Install as dev dependency → train team on core attributes → incrementally apply to new code (e.g., #[Deprecated] on deprecated methods) → retroactively add to high-value areas (DTOs, API responses). Zero-breaking changes to existing code.
Compatibility: Works with all PHP versions (attributes ignored by non-PhpStorm tools). Requires PhpStorm ≥2020.3 for full feature support. Backward-compatible for PHP ≤7.4 via single-line attribute syntax. No conflicts with other Composer packages.
Sequencing: 1) Add to composer.json as dev dependency. 2) Establish team guidelines for attribute usage (e.g., "use ObjectShape for all untyped object returns"). 3) Apply to new features first. 4) Prioritize retrofitting critical paths (e.g., API controllers, services with complex return types).
Maintenance: Minimal. JetBrains maintains the package with infrequent updates (last release Nov 2024). No ongoing configuration or monitoring required. Updates only needed when new PhpStorm versions introduce changes (rare).
Support: Official JetBrains support via YouTrack issue tracker. Community support through GitHub issues. No dedicated internal
How can I help you explore Laravel packages today?