gboquizosanchez / phpstan-report
Laravel package to display PHPStan errors in a view
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^8.3
- illuminate/console: ^11.0|^12.0
- illuminate/http: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
- illuminate/view: ^11.0|^12.0
- phpstan/phpstan: ^1.0|^2.0
Requires (Dev)
- hermes/dependencies: ^1.2
- laravel/pint: ^1.24
README
Overview
PHPStan Report is a Laravel package that provides an elegant web interface for viewing, analyzing, and managing PHPStan static analysis results. Transform your code quality insights into an interactive, user-friendly dashboard.
Features โจ
- ๐ฏ Dynamic Level Control - Adjust PHPStan analysis levels (1-10) through an intuitive web interface
- โก Real-time Analysis - Execute PHPStan analysis directly from your browser
- ๐ Beautiful Reports - View detailed analysis results with clear, organized presentation
- ๐ Theme Support - Switch between dark and light themes with session persistence
- ๐ Copy Functionality - One-click copy for error messages and solutions
- ๐ฑ Responsive Design - Optimized experience across mobile and desktop devices
- ๐ Composer Integration - Seamless integration with Composer scripts
- ๐พ Auto-save Settings - Automatically remembers your preferred configuration
Requirements
- PHP: 8.3+
- Laravel: 11.0+ or 12.0+
- Composer: Latest stable version
Installation
Install the package via Composer:
composer require gboquizo/phpstan-report
Quick Setup
Run the installation command to automatically configure PHPStan Report:
php artisan install:phpstan-report
This command performs the following actions:
- Creates
phpstan.neon
- Generates a configuration file with level 3 analysis (if not exists) - Publishes assets - Copies package assets to
public/vendor/phpstan-report
- Updates
composer.json
- Adds PHPStan script for easy execution - Runs initial analysis - Executes PHPStan analysis and asset discovery
Generated Configuration
The installation creates a basic phpstan.neon
configuration:
parameters: level: 3 paths: - app
You can customize this configuration according to your project needs.
Screenshots ๐
Usage
Accessing the Web Interface
Navigate to the PHPStan Report dashboard using any of these methods:
- Direct URL:
https://your-application.com/phpstan-report
- Artisan route list: Use
php artisan route:list --name=phpstan
to verify the route
Dashboard Features
๐ Analysis Dashboard
- Real-time statistics showing total errors, warnings, and analysis status
- File-based organization with expandable error lists
- Severity indicators with color-coded error types
โ๏ธ Level Management
- Interactive slider to adjust PHPStan analysis levels (1-10)
- Instant feedback showing level descriptions and expected behavior
- Automatic re-analysis when level changes are applied
๐ Analysis Execution
- One-click analysis button for immediate code scanning
- Progress indicators showing analysis status
- Success/error notifications with detailed feedback
๐จ User Experience
- Theme toggle between dark and light modes
- Persistent preferences saved across browser sessions
- Mobile-optimized interface for analysis on-the-go
- Copy-to-clipboard functionality for quick error sharing
Command Line Usage
You can also run PHPStan analysis through Composer:
# Run analysis (added by installation command)
composer phpstan-report
Getting Help
If you encounter issues:
- Check the logs - Laravel logs may contain helpful error messages
- Verify requirements - Ensure PHP and Laravel versions meet minimum requirements
- Clear cache - Run
php artisan config:clear
andphp artisan cache:clear
- Open an issue - Report bugs or request features
Contributing
We welcome contributions! Please feel free to:
- ๐ Report bugs through GitHub issues
- ๐ก Suggest features or improvements
- ๐ง Submit pull requests with bug fixes or enhancements
- ๐ Improve documentation or add examples
Credits ๐งโ๐ป
- Author: Germรกn Boquizo Sรกnchez
- Built with: PHPStan - The powerful PHP static analysis tool
- Framework: Laravel - The PHP framework
- Contributors: View all contributors
License
This package is open-source software licensed under the MIT License.
Dependencies
PHP dependencies ๐ฆ
Develop dependencies ๐ง
Develop dependencies ๐ง
Made with โค๏ธ for the PHP community