Commit ad1db11
committed
HTML API: Add sentinels for unreachable code.
There are places in the HTML API code where some tools get confused and flag invalid types for the return of a function because they are unable to detect that the end of the function is unreachable.
Since PHP doesn't provide a way to encode total matching in the source code, this patch adds a few extra lines in those unreachable locations to satisfy any tooling which isn't able to fully analyze the code.
Additionally this serves as extra guarding in case someone changes these functions in a way which would break them and the existing test suite doesn't catch those breakages.
Developed in #7315
Discussed in https://core.trac.wordpress.org/ticket/62018
Props dlh, dmsnell.
Fixes #62018.
git-svn-id: https://develop.svn.wordpress.org/trunk@59001 602fd350-edb4-49c9-b593-d223f7449a821 parent 13e0e50 commit ad1db11
2 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2770 | 2770 | | |
2771 | 2771 | | |
2772 | 2772 | | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
2773 | 2777 | | |
2774 | 2778 | | |
2775 | 2779 | | |
| |||
4645 | 4649 | | |
4646 | 4650 | | |
4647 | 4651 | | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
4648 | 4656 | | |
4649 | 4657 | | |
4650 | 4658 | | |
| |||
5878 | 5886 | | |
5879 | 5887 | | |
5880 | 5888 | | |
| 5889 | + | |
| 5890 | + | |
| 5891 | + | |
| 5892 | + | |
5881 | 5893 | | |
5882 | 5894 | | |
5883 | 5895 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2965 | 2965 | | |
2966 | 2966 | | |
2967 | 2967 | | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
2968 | 2971 | | |
2969 | 2972 | | |
2970 | 2973 | | |
| |||
0 commit comments