roniestein/package-macro-autocomplete
Composer 安装命令:
composer require roniestein/package-macro-autocomplete
包简介
A helper package that allows barryvdh/laravel-ide-helper find and index macros stored in packages
README 文档
README
PackageMacroAutocomplete's only job is to pull your macro's into a file that PHPStorm and possibly other IDE's can read and place in your project so that you gain auto completion for package macros. This package is designed to be used as a helper for barryvdh/laravel-ide-helper
composer require roniestein/package-macro-autocomplete --dev
In your packages src directory simply add the file AutoCompletionHelper.php
Add the Macros you want to be imported into the ide as follows:
<?php namespace Illuminate\Http; /** * @method bool validate(array $rules, ...$params) Validate the given request with the given rules. * @method array validated() Get the validated data from the request. */ class Request { } namespace Illuminate\Support; use App\User; /** * @method bool fiddler($roof) Check if he is on the roof. * @method array shaboom($shaboom) La la la la la la la * @method User user() */ class Collection { }
When you are ready to import all the organized macros in your package, simply run the command
php artisan autocomplete:generate
This will read AutoCompletionHelper.php files in each of the required packages and create a _package_macro_ide_helper.php file in your root directory with all the macros listed.
PHPStorm will index that file and add the listed macro signatures to autocomplete.
autocomplete:generate takes one optional parameter that is the file name, however it will add on the php extension. If you want something other that the _package_macro_ide_helper.php, run
php artisan autocomplete:generate MyAwesomeFilename
and MyAwesomeFilename.php will be added to the root of your project for PHPStorm to consume.
To make this part of your build, add the command to your composer.json after barryvdh/laravel-ide-helper update scripts.
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan ide-helper:generate",
"@php artisan ide-helper:meta"
"@php artisan autocomplete:generate"
],
``
roniestein/package-macro-autocomplete 适用场景与选型建议
roniestein/package-macro-autocomplete 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.34k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 09 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 roniestein/package-macro-autocomplete 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 roniestein/package-macro-autocomplete 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-19