wwwision/types-phpstan
Composer 安装命令:
composer require wwwision/types-phpstan
包简介
Custom PHPStan rules for wwwision/types
README 文档
README
Custom PHPStan rules and extensions for the wwwision/types package
What's included
- Rules that enforce the best practices for
#[TypeBased]classes (must befinal,readonly, have a private constructor and never be constructed directly). - A reflection extension for dynamic schemas: instances of
DynamicRecordare read via__get, so PHPStan would normally report$record->somePropertyas access to an undefined property. The extension teaches PHPStan that any property of aDynamicRecordis a readable (immutable)mixedvalue, so object-accessor syntax type-checks. (A dynamic record's shape is only known at runtime, so per-property types cannot be inferred.)
Installation
To use this extension, require it in Composer:
composer require --dev wwwision/types-phpstan
If you also install phpstan/extension-installer then you're all set!
Manual installation
If you don't want to use phpstan/extension-installer, include rules.neon in your project's PHPStan config:
includes:
- vendor/wwwision/types-phpstan/rules.neon
统计信息
- 总下载量: 3.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-20