tomasvotruba / bladestan
PHPStan rule for static analysis of Blade templates
Fund package maintenance!
tomasvotruba
www.paypal.me/rectorphp
Installs: 264 655
Dependents: 5
Suggesters: 0
Security: 0
Stars: 323
Watchers: 6
Forks: 16
Open Issues: 6
Type:phpstan-extension
Requires
- php: ^8.2
- illuminate/contracts: ^11.15
- illuminate/filesystem: ^11.15
- illuminate/mail: ^11.15
- illuminate/notifications: ^11.15
- illuminate/view: ^11.15
- larastan/larastan: ^3.0
- livewire/livewire: ^3.3.5
- phpstan/phpstan: ^2.0.1
Requires (Dev)
- orchestra/testbench: ^9.9
- phpunit/phpunit: ^11.3.6
- rector/rector: ^2.0
- symplify/easy-coding-standard: ^12.1.1
- tomasvotruba/class-leak: ^0.2.6
This package is auto-updated.
Last update: 2025-02-19 18:55:58 UTC
README
Bladestan
Static analysis for Blade templates in Laravel projects.
Install
composer require tomasvotruba/bladestan --dev
Configure
If you run PHPStan with its extension installer, Bladestan will just work, if not you need to include it in the phpstan.neon
configuration file:
includes: - ./vendor/tomasvotruba/bladestan/config/extension.neon
Features
Custom Error Formatter
We provide custom PHPStan error formatter to better display the template errors:
- clickable template file path link to the error in blade template
------ ----------------------------------------------------------- Line app/Http/Controllers/PostCodexController.php ------ ----------------------------------------------------------- 20 Call to an undefined method App\Entity\Post::getContent(). rendered in: post_codex.blade.php:15 ------ -----------------------------------------------------------
How to use custom error formatter?
vendor/bin/phpstan analyze --error-format=blade
Credits
- Can Vural - this package is based on that, with upgrade for Laravel 10 and active maintenance
- All Contributors