xf-typegen

xf-typegen 1.0.1

没有下载权限
XF 兼容性
  1. 2.3.x
摘要
XenForo type generator tool fills gaps left by core, types board options, XFCP proxies, and cross-addon columns. Use xf-typegen with --out to generate PHPStorm metadata JSON files for better IDE support. Open source at https://github.com/wh1teend/xf-typegen.

What it does​

XenForo already types most of its own runtime magic — xf-dev:generate-phpstorm-meta (shipped in 2.2 and 2.3) resolves the string-style call sites, entities ship full @property, and on 2.3 generics handle the ::class style and the finder chain. This tool is narrow on purpose: it fills the few gaps core leaves.

What core doesn't type, either version:
  • Board options — \XF:😱ptions()->boardTitle is mixed; this gives it a real type.
  • XFCP proxies — class Foo extends XFCP_Foo points at a runtime-built class with no file, flagged undefined; this declares them.
  • Cross-add-on columns — a column another add-on adds to an entity via XFCP isn't in that entity's shipped @property; this reads the composed structure, so they're included.
On 2.2 only, it also types the finder chain (finder('XF:User')->fetchOne() to the concrete entity), which 2.2 can't do without generics.

If you're on 2.3 and none of those bite you, the stock dev tools already cover you.

  • _ide_helper_options.php — one typed property per board option.
  • _ide_helper_xfcp.php — declarations for the runtime XFCP_* proxies.
  • _ide_helper.php — typed Finder/Collection stubs (mainly for 2.2) + entity @property from the composed structure.
  • .phpstorm.meta.php — string-style call-site resolution (duplicates xf-dev:generate-phpstorm-meta; skip with --targets options,xfcp,ide-helper).


代码:
xf-typegen extract /path/to/xenforo --out /path/to/xenforo/xf-typegen.json
xf-typegen generate -i /path/to/xenforo/xf-typegen.json
Keep the _ide_helper*.php files out of your PHP autoload — static analysis only.


Open source (MIT), prebuilt for Linux / macOS / Windows:
https://github.com/wh1teend/xf-typegen
作者
axtona
浏览
12
首次发布
上次更新
评分 0.00 星 0 个评分
链接失效了吗? 发送消息 给 NP 团队,我们会尽快为您处理!
支持开发者 如果您对测试满意或项目已成功盈利,可点击「更多信息」按钮,通过购买来支持开发者!

来自 axtona 的更多资源

Add Trending Content to a Page node A
Links a Trending Content widget contents to a page node.
Persona - 个性化你的论坛身份 A
Persona为论坛上的每一个成员提供了工具,让他们能够打造自己的存在感。
附件完整性 A
附件完整性 5.7.4.1
附件完整性是一个强大的附件审计、修复和存储分析插件
返回
顶部