Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Constants were exported without their documentation, and class constants were not exported at all. Now each constant carries its DocBlock in
doc, and each class gets aconstantslist. For example,WP_Theme_JSON::LATEST_SCHEMA:{ "name": "LATEST_SCHEMA", "line": 1078, "end_line": 1078, "value": "3", "doc": { "description": "The latest version of the schema in use.", "tags": [ { "name": "since", "content": "5.8.0" }, … ] } }Every corpus-diff hunk is one of these two added keys.
Testing
vendor/bin/phpunit(withWP_TESTS_DIRset): 172 tests pass on PHP 7.4 and 8.3; the newExport_Constantstests fail onmaster.wp parser export wp-content/plugins/phpdoc-parser/tests/phpunit/tests/export/constants.inc out.json: inout.json,TEST_DEFINED_CONSTANT(define()) andTEST_CONST_CONSTANT(const) havedoc.descriptionset, andclasses[0].constants[0]isTEST_CLASS_CONSTANTwithvalue"2"anddoc.description"A class constant."wp parser export wp-includes/class-wp-theme-json.php out.json:LATEST_SCHEMAmatches the example above.Possible follow-ups (happy to work on these if they're useful):
Part of #269