pieceofcake2/phpstan-cakephp2
最新稳定版本:v0.2.1
Composer 安装命令:
composer require pieceofcake2/phpstan-cakephp2
包简介
An extension to help test CakePHP 2 projects with PHPStan
README 文档
README
PHPStan extensions to help test CakePHP 2 projects with PHPStan
Requirements
- PHP 8.0+
- phpstan/phpstan 1.9+
- pieceofcake2/cakephp 2.x
Installation
Installation is best done through composer:
composer require --dev pieceofcake2/phpstan-cakephp2
You will need to make sure the extension is included in your phpstan config:
# phpstan.neon includes: - vendor/pieceofcake2/phpstan-cakephp2/extension.neon
If you have behavior classes in odd locations (perhaps in a vendor directory) you will need to add those locations to your configuration. For example:
# phpstan.neon parameters: ModelBehaviorsExtension: behaviorPaths: - vendor/my-vendor/my-plugin/src/Model/Behavior/*.php
See extension.neon for the default list of behavior locations.
Features
The following features are added to PHPStan:
- Treat behavior methods as extra methods on all models (
$model->behaviorMethod()) - Treat controller properties named after model classes as instances of those classes (
$controller->Model) - Treat controller properties named after component classes as instances of those classes (
$controller->Component) - Treat component properties names after component classes as instances of those classes (
$component->Component) - Treat
ClassRegistry::init($className)as returning an instance of$classNamewhere possible
统计信息
- 总下载量: 6.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 20
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-05