tomasvotruba / bladestan
PHPStan rule for static analysis of Blade templates
Fund package maintenance!
tomasvotruba
www.paypal.me/rectorphp
Installs: 204 661
Dependents: 4
Suggesters: 0
Security: 0
Stars: 293
Watchers: 6
Forks: 13
Open Issues: 27
Type:phpstan-extension
Requires
- php: ^8.1
- illuminate/contracts: ^9.0 || ^10.0 || ^11.0
- illuminate/filesystem: ^9.0 || ^10.0 || ^11.0
- illuminate/view: ^9.0 || ^10.0 || ^11.0
- phpstan/phpstan: ^1.10
Requires (Dev)
- laravel/framework: ^10.40
- nikic/php-parser: ^4.18
- phpunit/phpunit: ^10.0
- rector/rector: ^0.19
- symplify/easy-ci: ^11.3
- symplify/easy-coding-standard: ^12.1
- tomasvotruba/class-leak: ^0.2.6
- tracy/tracy: ^2.9
This package is auto-updated.
Last update: 2024-11-04 07:36:18 UTC
README
Static analysis for Blade templates in Laravel projects.
Install
composer require tomasvotruba/bladestan --dev
Configure
Configure paths to your Blade views, unless you use the default resources/views
directory:
parameters: bladestan: template_paths: # default - resources/views
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::getConten(). 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