Changeset 64250
- Timestamp:
- 10/09/2026 04:55:54 AM (25 hours ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 5 edited
-
phpstan.neon.dist (modified) (2 diffs)
-
src/wp-includes/html-api/class-wp-html-processor.php (modified) (20 diffs)
-
tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon (modified) (1 diff)
-
tests/phpstan/baselines/deadCode.unreachable.neon (modified) (1 diff)
-
tests/phpstan/baselines/greater.alwaysTrue.neon (deleted)
-
tests/phpstan/baselines/greaterOrEqual.alwaysFalse.neon (deleted)
-
tests/phpstan/baselines/if.alwaysTrue.neon (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpstan.neon.dist
r64237 r64250 43 43 - tests/phpstan/baselines/function.impossibleType.neon 44 44 - tests/phpstan/baselines/function.resultUnused.neon 45 - tests/phpstan/baselines/greater.alwaysTrue.neon46 - tests/phpstan/baselines/greaterOrEqual.alwaysFalse.neon47 45 - tests/phpstan/baselines/greaterOrEqual.alwaysTrue.neon 48 46 - tests/phpstan/baselines/identical.alwaysFalse.neon … … 153 151 path: src/wp-includes/html-api/class-wp-html-tag-processor.php 154 152 reportUnmatched: false 153 154 # HTML API: 155 # These errors are ignored for the sake of making it easier to keep the HTML Processor in sync with the HTML spec. 156 - 157 message: '#^Comparison operation "\>" between 999\|1000 and 0 is always true\.$#' 158 identifier: greater.alwaysTrue 159 count: 1 160 path: src/wp-includes/html-api/class-wp-html-processor.php 161 - 162 message: '#^Comparison operation "\>\=" between 0 and 8 is always false\.$#' 163 identifier: greaterOrEqual.alwaysFalse 164 count: 1 165 path: src/wp-includes/html-api/class-wp-html-processor.php -
trunk/src/wp-includes/html-api/class-wp-html-processor.php
r63790 r64250 1586 1586 } 1587 1587 goto initial_anything_else; 1588 break;1589 1588 1590 1589 /* … … 1679 1678 } 1680 1679 goto before_html_anything_else; 1681 break;1682 1680 1683 1681 /* … … 1701 1699 */ 1702 1700 goto before_html_anything_else; 1703 break;1704 1701 } 1705 1702 … … 1761 1758 } 1762 1759 goto before_head_anything_else; 1763 break;1764 1760 1765 1761 /* … … 1806 1802 case '-HTML': 1807 1803 goto before_head_anything_else; 1808 break;1809 1804 } 1810 1805 … … 1862 1857 1863 1858 goto in_head_anything_else; 1864 break;1865 1859 1866 1860 /* … … 1994 1988 */ 1995 1989 goto in_head_anything_else; 1996 break;1997 1990 1998 1991 /* … … 2087 2080 2088 2081 goto in_head_noscript_anything_else; 2089 break;2090 2082 2091 2083 /* … … 2191 2183 } 2192 2184 goto after_head_anything_else; 2193 break;2194 2185 2195 2186 /* … … 2280 2271 */ 2281 2272 goto after_head_anything_else; 2282 break;2283 2273 } 2284 2274 … … 2784 2774 $this->state->stack_of_open_elements->remove_node( $node ); 2785 2775 return true; 2786 } else { 2787 /* 2788 * > If the stack of open elements does not have a form element in scope, 2789 * > then this is a parse error; return and ignore the token. 2790 * 2791 * Note that unlike in the clause above, this is checking for any FORM in scope. 2792 */ 2793 if ( ! $this->state->stack_of_open_elements->has_element_in_scope( 'FORM' ) ) { 2794 // Parse error: ignore the token. 2795 return $this->step(); 2796 } 2797 2798 $this->generate_implied_end_tags(); 2799 2800 if ( ! $this->state->stack_of_open_elements->current_node_is( 'FORM' ) ) { 2801 // @todo Indicate a parse error once it's possible. This error does not impact the logic here. 2802 } 2803 2804 $this->state->stack_of_open_elements->pop_until( 'FORM' ); 2805 return true; 2806 } 2807 break; 2776 } 2777 2778 /* 2779 * > If the stack of open elements does not have a form element in scope, 2780 * > then this is a parse error; return and ignore the token. 2781 * 2782 * Note that unlike in the clause above, this is checking for any FORM in scope. 2783 */ 2784 if ( ! $this->state->stack_of_open_elements->has_element_in_scope( 'FORM' ) ) { 2785 // Parse error: ignore the token. 2786 return $this->step(); 2787 } 2788 2789 $this->generate_implied_end_tags(); 2790 2791 if ( ! $this->state->stack_of_open_elements->current_node_is( 'FORM' ) ) { 2792 // @todo Indicate a parse error once it's possible. This error does not impact the logic here. 2793 } 2794 2795 $this->state->stack_of_open_elements->pop_until( 'FORM' ); 2796 return true; 2808 2797 2809 2798 /* … … 3367 3356 return $this->in_body_any_other_end_tag(); 3368 3357 } 3369 3370 $this->bail( 'Should not have been able to reach end of IN BODY processing. Check HTML API code.' );3371 // This unnecessary return prevents tools from inaccurately reporting type errors.3372 return false;3373 3358 } 3374 3359 … … 3419 3404 3420 3405 $this->bail( 'Should not have been able to reach end of "any other end tag" IN BODY processing. Check HTML API code.' ); 3421 // This unnecessary return prevents tools from inaccurately reporting type errors.3422 return false;3423 3406 } 3424 3407 … … 3497 3480 // Non-whitespace would trigger fostering, unsupported at this time. 3498 3481 $this->bail( 'Foster parenting is not supported.' ); 3499 break;3500 3482 } 3501 3483 break; … … 3822 3804 3823 3805 goto in_column_group_anything_else; 3824 break;3825 3806 3826 3807 /* … … 4383 4364 } 4384 4365 goto after_body_anything_else; 4385 break;4386 4366 4387 4367 /* … … 4706 4686 } 4707 4687 goto after_after_body_anything_else; 4708 break;4709 4688 } 4710 4689 … … 4985 4964 } 4986 4965 return true; 4987 } 4988 4989 /* 4990 * > An end tag whose name is "script", if the current node is an SVG script element. 4991 */ 4992 if ( $this->is_tag_closer() && 'SCRIPT' === $this->state->current_token->node_name && 'svg' === $this->state->current_token->namespace ) { 4993 $this->state->stack_of_open_elements->pop(); 4994 return true; 4995 } 4996 4997 /* 4998 * > Any other end tag 4999 */ 5000 if ( $this->is_tag_closer() ) { 4966 } else { 4967 /* 4968 * > An end tag whose name is "script", if the current node is an SVG script element. 4969 */ 4970 if ( 'SCRIPT' === $this->state->current_token->node_name && 'svg' === $this->state->current_token->namespace ) { 4971 $this->state->stack_of_open_elements->pop(); 4972 return true; 4973 } 4974 4975 /* 4976 * > Any other end tag 4977 */ 5001 4978 $node = $this->state->stack_of_open_elements->current_node(); 5002 4979 if ( $tag_name !== $node->node_name ) { … … 5098 5075 } 5099 5076 } 5100 5101 $this->bail( 'Should not have been able to reach end of IN FOREIGN CONTENT processing. Check HTML API code.' );5102 // This unnecessary return prevents tools from inaccurately reporting type errors.5103 return false;5104 5077 } 5105 5078 … … 6389 6362 6390 6363 $this->bail( 'Should not have reached end of HTML Integration Point detection: check HTML API code.' ); 6391 // This unnecessary return prevents tools from inaccurately reporting type errors.6392 return false;6393 6364 } 6394 6365 -
trunk/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon
r63542 r64250 34 34 count: 1 35 35 path: ../../../src/wp-includes/canonical.php 36 -37 message: '#^Left side of && is always true\.$#'38 identifier: booleanAnd.leftAlwaysTrue39 count: 140 path: ../../../src/wp-includes/html-api/class-wp-html-processor.php -
trunk/tests/phpstan/baselines/deadCode.unreachable.neon
r64073 r64250 57 57 message: '#^Unreachable statement \- code above always terminates\.$#' 58 58 identifier: deadCode.unreachable 59 count: 3159 count: 12 60 60 path: ../../../src/wp-includes/html-api/class-wp-html-processor.php 61 61 - -
trunk/tests/phpstan/baselines/if.alwaysTrue.neon
r63357 r64250 47 47 message: '#^If condition is always true\.$#' 48 48 identifier: if.alwaysTrue 49 count: 249 count: 1 50 50 path: ../../../src/wp-includes/html-api/class-wp-html-processor.php
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)