This is a generalization of the issue #856. Thank you to @cmb69 on that one.
I have gone out to find every instance of a PHP function which is defined as possibly returning a false value but where the return value documentation does not mention the possibility of a false return value.
I created this list of candidates using:
grep --files-with-matches --recursive '<type class="union"><type>\w\+</type><type>false</type></type>' . > ~/Desktop/canoutputfalse
grep --files-with-matches --recursive '&return.falseforfailure;' . > ~/Desktop/falseforfailure
cat ~/Desktop/canoutputfalse ~/Desktop/falseforfailure ~/Desktop/falseforfailure | sort | uniq -u > ~/Desktop/reviewthese
code $(cat ~/Desktop/reviewthese)
And manually reviewing each one.
This is part of my efforts in #858. And please ftlog review and approve that PR first so it can be merged without sitting around!
The list
My understanding is that this list is comprehensive, I don't think you will find any more that could fit in this category.
Work plan
For each one of these in the list, we should read the implementation and either:
- If the function CANNOT return
false, then remove the false in the definition at top.
- If the function CAN return
false, then explain this in the return value section.
This is a generalization of the issue #856. Thank you to @cmb69 on that one.
I have gone out to find every instance of a PHP function which is defined as possibly returning a
falsevalue but where the return value documentation does not mention the possibility of afalsereturn value.I created this list of candidates using:
And manually reviewing each one.
This is part of my efforts in #858. And please ftlog review and approve that PR first so it can be merged without sitting around!
The list
false)My understanding is that this list is comprehensive, I don't think you will find any more that could fit in this category.
Work plan
For each one of these in the list, we should read the implementation and either:
false, then remove thefalsein the definition at top.false, then explain this in the return value section.