Skip to content

Commit b7d9934

Browse files
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

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"php" : ">=7.4",
2424
"composer/installers" : "~1.0",
2525
"nikic/php-parser" : "^5.7",
26-
"phpdocumentor/reflection-docblock" : "~2.0",
26+
"phpdocumentor/reflection-docblock" : "^5",
2727
"erusev/parsedown" : "~1.7",
2828
"scribu/lib-posts-to-posts": "dev-master@dev",
2929
"scribu/scb-framework" : "dev-master@dev",

‎composer.lock‎

Lines changed: 294 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)