Commit f2ed3a6
committed
fix(api): stop documenting imports, keep docblocks on guarded declarations
Two token-scanner bugs made the generated PHP API reference wrong.
'use function foo;' imports a function, it does not declare one, but the
scanner took the name after any 'function' keyword. SearchWidget.php's
import block alone produced ten phantom functions, namespaced to the
importing file. Three reached the published site, two of them duplicate
pages for gravityview_get_form_fields sitting beside the real one, each
with no signature, description, or parameters.
Separately, a docblock was dropped whenever a conditional-declaration
guard sat between it and its symbol. WordPress code routinely writes
'if ( ! function_exists( 'x' ) ) { function x() {} }', and GravityView
3.0 moved connector-functions.php to src/Utils and adopted that idiom,
so all 31 functions in it lost their prose, parameter types, returns,
and — for gravityview_get_template_id — its 3.0.0 deprecation notice.
Only *_exists() predicates bridge, so a file guard such as
'if ( ! defined( 'ABSPATH' ) )' still stops a docblock as before.
Verified against GravityView develop: phantoms 10 -> 0 in that file,
docblocks 0 -> 31 in connector-functions.php. Across all 37 products
the published symbol set loses exactly the 3 phantoms and gains
nothing else. Unit tests and a full build pass.1 parent 29b3cc9 commit f2ed3a6
1 file changed
Lines changed: 84 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
109 | 165 | | |
110 | 166 | | |
111 | 167 | | |
| |||
228 | 284 | | |
229 | 285 | | |
230 | 286 | | |
| 287 | + | |
231 | 288 | | |
232 | 289 | | |
233 | 290 | | |
| |||
242 | 299 | | |
243 | 300 | | |
244 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
245 | 325 | | |
246 | 326 | | |
247 | 327 | | |
| |||
518 | 598 | | |
519 | 599 | | |
520 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
521 | 605 | | |
522 | 606 | | |
523 | 607 | | |
| |||
0 commit comments