calebdw / larastan-livewire
Laravel Livewire 的 Larastan / PHPStan 扩展。
v1.1.0
2024-09-06 23:14 UTC
Requires
- php: ^8.1
- illuminate/support: ^10.0 || ^11.0
- livewire/livewire: ^3.3
- phpstan/phpstan: ^1.10
Requires (Dev)
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2024-09-06 23:15:43 UTC
README
这是一个为 Larastan / PHPStan 提供的 Laravel Livewire 扩展。
安装
composer require calebdw/larastan-livewire --dev
如果您已经安装了 PHPStan 扩展安装器,则无需其他操作,否则您需要手动将扩展包含在 phpstan.neon(.dist) 配置文件中。
includes: - ./vendor/calebdw/larastan-livewire/extension.neon
功能
计算属性
计算属性 可以正确地从应用了 Computed 属性的方法中解析。
<?php use Livewire\Attributes\Computed; use Livewire\Component; class ShowPost extends Component { #[Computed] public function post() { return Post::find($this->postId); } }
获取器样式
支持旧版的,"getter" 样式的属性。
<?php use Livewire\Component; class ShowPost extends Component { // Computed Property public function getPostProperty() { return Post::find($this->postId); } }
贡献
感谢您考虑贡献!您可以在此处阅读贡献指南 here。
许可证
Larastan-Livewire 是开源软件,使用 MIT 许可证 许可。
