DocBlocks for filters inside a conditional expression are not imported
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- php
- Domain
- documentation
Research direction
Start by reproducing the two PHP examples and tracing how apply_filters calls inside conditional expressions are associated with DocBlocks. Compare the parser's result for both examples with the expected filter documentation, including wp_save_post_revision_check_for_changes. Done means DocBlock 2 is assigned to in_conditional_expression and the correct DocBlock is assigned to in_conditional.
Written by the indexing model from the issue text.
Description
DocBlocks outside a conditional are not imported if there are other filters (with DocBlocks) within the conditional.
Example 1
In this example DocBlock 2 is not imported for the filter in_conditional_expression
/**
* DocBlock 1
*/
function test_docblocks() {
/**
* DocBlock 2
*/
if ( apply_filters( 'in_conditional_expression', true ) ) {
/**
* DocBlock 3
*/
$value = apply_filters( 'in_conditional', true );
}
}
Example 2
In this example the (wrong) DocBlock 2 is imported for the filter 'in_conditional`.
/**
* DocBlock 1
*/
function test_docblocks() {
/**
* DocBlock 2
*/
if ( apply_filters( 'in_conditional_expression', true ) ) {
$value = apply_filters( 'in_conditional', true );
}
}
The wp_save_post_revision_check_for_changes filter doesn't get its DocBlock imported because of this bug.
See this filter in trac
- Dominant language
- PHP
- Stars
- 239
- Forks
- 81
- Avg merge
- 16h 29m
- Merged PRs (30d)
- 8
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WordPress/phpdoc-parser
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
WordPress/phpdoc-parser#269 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
WordPress/phpdoc-parser#268 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
WordPress/phpdoc-parser#254 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WordPress/phpdoc-parser#246 · 9 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
WordPress/phpdoc-parser#235 · 1 comment ·
All issues in WordPress/phpdoc-parser
Similar issues
-
tooling
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
UX
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ProfessionalWiki/NeoWiki#1525 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
OpenConext/OpenConext-engineblock#2122 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/safe-publish#594 ·