Skip to content

Conversation

@dd32
Copy link
Member

@dd32 dd32 commented Sep 8, 2025

See #246, #228.

Since I have no hope of personally being able to upgrade the parser any time soon, I took a different approach of making the existing parser work with current-day WordPress.

This requires "downgrading" PHP syntax used in Core to a syntax that the parser recognises.

I've attempted to not edit the source files on disk, such that the source importer gets the correct source.

I've attempted to keep the syntax that it's converted to mostly the same meaning as the existing code, this ensures that any fancyness in resolving that the parser includes still works.

There may have been libraries to transpile WordPress into PHP5 syntax, but I didn't want to use this as it would alter the line numbers of code, causing the source extractor to fail to find the correct code.

This has been tested within the included wp-env environment only.

Unfortunately I didn't take note of examples of the code that each regex is affecting, so you might just have to take my word for it..
I'll try running this on WordPress.org tomorrow to update developer.w.org

…erstand. This also requires a patch against phpdocumentor/reflection.
@johnbillion
Copy link
Member

johnbillion commented Sep 8, 2025

FYI I started work on rewriting the parser (using an AI coding agent) in #247 but it needs more work. Edit: Actually it's in a good place! Tests are all passing but it needs review.

@dd32
Copy link
Member Author

dd32 commented Sep 9, 2025

@johnbillion Oh! I didn't realise that was in a good state, I thought it was a long way off..

I'll run a full export of the codebase using this PR, and then with that PR, and see what the diffs between the generated data is!

@dd32
Copy link
Member Author

dd32 commented Sep 22, 2025

closing in favour of #247 as this allowed things to not-fatal, but didn't seem to generate a full exported doc.

@dd32 dd32 closed this Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants