Commit b7d9934
committed
Parse docblocks with mainline phpdocumentor/reflection-docblock ^5
Replace the abandoned 2.0.5 release (2016) with the current 5.x series.
Docblocks are parsed by a shared DocBlockFactory; the mutable per-file
namespace state moves to a first-party File_Context that produces the
immutable Types\Context the v5 parser expects.
The export format is unchanged and all 22 existing tests pass without
modification. The exporter reproduces legacy semantics where v5 differs:
- `@since MU (3.0.0)` and other non-semver WP version conventions fall
back to the raw tag body (all 250 corpus occurrences preserved).
- `@see`/`@uses` references that are not resolvable code elements, such
as `@see 'hook_name'`, keep their `refers` value via a legacy-style
split instead of being dropped as invalid.
- `@link` tags without a description use the URL as content.
- Long descriptions get the same `<code>` wrapping and Markdown pass.
Remaining output differences against a full wp-admin/includes and
wp-includes corpus (~0.8% of normalized lines) were audited and are
fixes, not regressions:
- Generic and nullable types now parse correctly (`array<string,int>`,
`?string`) instead of leaking mangled tokens like `\array<string,`
into types and tag content.
- By-reference parameters (`&$var`) now export their variable name.
- References and inline `{@see}` in namespaced bundled libraries
(SimplePie, PHPMailer) resolve to fully qualified names; none of the
1808 corpus references are lost.
- Whitespace runs from docblock line-wrapping alignment collapse to a
single space, which HTML rendering already did.1 parent 60f7ae3 commit b7d9934
9 files changed
Lines changed: 577 additions & 81 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments