nazonohito51 / cakephp2-ide-helper
改善 cakephp2 的自动完成功能
0.2.5
2021-06-22 01:13 UTC
Requires
- barryvdh/reflection-docblock: ^2.0
- clue/graph: ^0.9.0
- nikic/php-parser: ^4.0
- symfony/console: >=3
Requires (Dev)
- phpunit/phpunit: >=7.5
README
安装
composer global require "nazonohito51/cakephp2-ide-helper"
建议添加 .gitignore_global
或 .gitignore
。
.phpstorm.meta.php
_ide_helper.php
基本用法
generate:meta
path/to/your/vendor/bin/cakephp2-ide-helper generate:meta --app-dir=./app
生成 .phpstorm.meta.php
. 查看示例.
generate:helper
path/to/your/vendor/bin/cakephp2-ide-helper generate:helper --app-dir=./app
生成 _ide_helper.php
. 查看示例.
generate:model
path/to/your/vendor/bin/cakephp2-ide-helper generate:controller --app-dir=./app --git-root=./
更新模型 phpdoc,用于行为方法代码补全。如果存在重复模型,此命令将失败。在这种情况下,您需要使用 --ignore
选项。
generate:controller
path/to/your/vendor/bin/cakephp2-ide-helper generate:controller --app-dir=./app --git-root=./
更新控制器 phpdoc。
generate:shell
path/to/your/vendor/bin/cakephp2-ide-helper generate:shell --app-dir=./app --git-root=./
更新 shell phpdoc。
path/to/your/vendor/bin/cakephp2-ide-helper generate:model --app-dir=./app --git-root=./ --ignore=Model/SomeDuplicateClass.php
待办事项
- 从模型中读取 actsAs
- 从行为中读取公共方法
- 使用 diff 更新模型上的 phpdoc(使用 str_replace)
- 分析行为的返回类型
- 通过模型扩展图弃用行为方法
- 考虑使用 git 管理文件
- 跳过更新 phpdoc 为空的模型
- ClassRegistry 参数助手
- 构建参数助手
- fixture 参数助手(phpstorm meta)
- 控制器中的模型属性
- getDataSource
- Model::find('first', 'count' ...)
- Model::find('', ['condition'...])
- withRead 参数
- 忽略卸载行为
- 禁用行为扩展
- Controller/Shell 使用属性
- 考虑行为扩展
- 忽略抽象行为,或分配抽象关键字
- 考虑关于重复行为的