lukaskleinschmidt/kirby-types
最新稳定版本:2.0.2
Composer 安装命令:
composer require lukaskleinschmidt/kirby-types
包简介
Kirby Types
README 文档
README
Additional and extended type hints for your IDE.
Adds the kirby types:create command to your project.
This command will create a file in your projects root directory that your IDE will pick.
Note Make sure you have the
getkirby/cliinstalled to use the command
Installation
| Types | K3 | K4 |
|---|---|---|
| 1.1.2 | ✔️ | ❌ |
| 2.0.1 | ❌ | ✔️ |
Require this package with composer using the following command.
composer require --dev lukaskleinschmidt/kirby-types:^1.1
Usage
Simply run kirby types:create to create the type hints file.
Command Options
You can set the filename, force and include option when running the command.
kirby types:create --filename my-ide-helper --force --include
Options
You can use the following options in your config.php.
These are the plugin's default options.
return [ 'lukaskleinschmidt.types' => [ 'aliases' => [], 'decorators' => [], 'filename' => 'types.php', 'force' => false, 'include' => [ 'aliases', 'blueprints', 'decorators', 'methods', ], ], ];
Aliases
You can add your own aliases you want to include.
return [ 'lukaskleinschmidt.types' => [ 'aliases' => [ 'MyClass' => \LukasKleinschmidt\MyClass::class, ], ], ];
Decorators
You can modify methods and their DocBlock to improve IDE type hints.
The plugin has some default decorators already defined.
use LukasKleinschmidt\Types\Method; use Kirby\Cms\Layout; return [ 'lukaskleinschmidt.types' => [ 'decorators' => [ Layout::class => [ 'columns' => [ '@return \Kirby\Cms\LayoutColumns|\Kirby\Cms\LayoutColumn[]', ], ], ], ], ];
License
MIT
Credits
统计信息
- 总下载量: 4.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-21