swissspidy/phpstan-no-private
PHPStan extension that reports deprecation warnings when code uses “pseudo-private” elements marked with @access private. Helps prevent relying on internal classes, methods, functions, or properties. Easy install via Composer with optional extension-installer support.
Adopt if:
protected or public properties over private).Look elsewhere if:
For Executives: "This package helps us automate architectural best practices in our Laravel codebase. By integrating with PHPStan, we’ll catch and fix ‘leaky’ private methods/properties early—before they cause bugs or make the code harder to maintain. It’s a low-code, high-impact way to improve code quality, reduce technical debt, and align with modern Laravel practices. The setup is minimal, and the payoff is cleaner, more modular code that’s easier to test and extend. Think of it as a static analysis ‘lint’ for architecture."
For Engineering (Developers/Tech Leads): *"This is a PHPStan extension that enforces no private members in public APIs, which helps us:
For Architects/Tech Leads: *"This package enforces encapsulation by treating private member usage as a deprecation warning. Key benefits:
protected or public properties over private ones, improving testability.
We’ll need to phase in refactoring (e.g., start with new code or critical modules), but the long-term ROI is cleaner, more maintainable architecture."*How can I help you explore Laravel packages today?