Skip to content

Narrow bool return types to true when possible #2458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions reference/array/functions/natcasesort.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ Array
]]>
</screen>
<para>
For more information see: Martin Pool's <link
xlink:href="&url.strnatcmp;">Natural Order String Comparison</link>
For more information see: Martin Pool's <link xlink:href="&url.strnatcmp;">Natural Order String Comparison</link>
page.
</para>
</example>
Expand All @@ -131,7 +130,6 @@ Array
</para>
</refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
4 changes: 1 addition & 3 deletions reference/array/functions/natsort.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ Array
]]>
</screen>
<para>
For more information see: Martin Pool's <link
xlink:href="&url.strnatcmp;">Natural Order String Comparison</link>
For more information see: Martin Pool's <link xlink:href="&url.strnatcmp;">Natural Order String Comparison</link>
page.
</para>
</example>
Expand Down Expand Up @@ -191,7 +190,6 @@ Array
</para>
</refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
5 changes: 2 additions & 3 deletions reference/array/functions/shuffle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>shuffle</methodname>
<type>true</type><methodname>shuffle</methodname>
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
</methodsynopsis>
<para>
Expand All @@ -34,7 +34,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
&return.true.always;
</para>
</refsect1>
<refsect1 role="changelog">
Expand Down Expand Up @@ -97,7 +97,6 @@ foreach ($numbers as $number) {
</para>
</refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
4 changes: 2 additions & 2 deletions reference/dom/domcharacterdata/appenddata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="DOMCharacterData">
<modifier>public</modifier> <type>bool</type><methodname>DOMCharacterData::appendData</methodname>
<modifier>public</modifier> <type>true</type><methodname>DOMCharacterData::appendData</methodname>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<para>
Expand All @@ -35,7 +35,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
&return.true.always;
</para>
</refsect1>
<refsect1 role="seealso">
Expand Down
5 changes: 2 additions & 3 deletions reference/errorfunc/functions/restore-error-handler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>restore_error_handler</methodname>
<type>true</type><methodname>restore_error_handler</methodname>
<void/>
</methodsynopsis>
<para>
Expand All @@ -27,7 +27,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This function always returns &true;.
&return.true.always;
</para>
</refsect1>

Expand Down Expand Up @@ -77,7 +77,6 @@ Invalid serialized value.
</para>
</refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
5 changes: 2 additions & 3 deletions reference/errorfunc/functions/restore-exception-handler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>restore_exception_handler</methodname>
<type>true</type><methodname>restore_exception_handler</methodname>
<void/>
</methodsynopsis>
<para>
Expand All @@ -30,7 +30,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This function always returns &true;.
&return.true.always;
</para>
</refsect1>

Expand Down Expand Up @@ -83,7 +83,6 @@
</para>
</refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
4 changes: 2 additions & 2 deletions reference/info/functions/phpcredits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>phpcredits</methodname>
<type>true</type><methodname>phpcredits</methodname>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>CREDITS_ALL</constant></initializer></methodparam>
</methodsynopsis>
<para>
Expand Down Expand Up @@ -99,7 +99,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
&return.true.always;
</para>
</refsect1>

Expand Down
13 changes: 5 additions & 8 deletions reference/info/functions/phpinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>phpinfo</methodname>
<type>true</type><methodname>phpinfo</methodname>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>INFO_ALL</constant></initializer></methodparam>
</methodsynopsis>
<para>
Expand All @@ -21,8 +21,7 @@
</para>
<para>
Because every system is setup differently, <function>phpinfo</function> is
commonly used to check <link
linkend="configuration">configuration settings</link> and for available
commonly used to check <link linkend="configuration">configuration settings</link> and for available
<link linkend="language.variables.predefined">predefined variables</link>
on a given system.
</para>
Expand All @@ -44,8 +43,7 @@
following <emphasis>constants</emphasis> bitwise values summed
together in the optional <parameter>flags</parameter> parameter.
One can also combine the respective constants or bitwise values
together with the <link
linkend="language.operators.bitwise">bitwise or operator</link>.
together with the <link linkend="language.operators.bitwise">bitwise or operator</link>.
</para>
<para>
<table>
Expand Down Expand Up @@ -111,8 +109,7 @@
<entry>INFO_LICENSE</entry>
<entry>64</entry>
<entry>
PHP License information. See also the <link
xlink:href="&url.php.license;">license FAQ</link>.
PHP License information. See also the <link xlink:href="&url.php.license;">license FAQ</link>.
</entry>
</row>
<row>
Expand All @@ -135,7 +132,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
&return.true.always;
</para>
</refsect1>

Expand Down
30 changes: 27 additions & 3 deletions reference/mysqli/mysqli/close.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
&reftitle.description;
<para>&style.oop;</para>
<methodsynopsis role="mysqli">
<modifier>public</modifier> <type>bool</type><methodname>mysqli::close</methodname>
<modifier>public</modifier> <type>true</type><methodname>mysqli::close</methodname>
<void/>
</methodsynopsis>
<para>&style.procedural;</para>
<methodsynopsis>
<type>bool</type><methodname>mysqli_close</methodname>
<type>true</type><methodname>mysqli_close</methodname>
<methodparam><type>mysqli</type><parameter>mysql</parameter></methodparam>
</methodsynopsis>
<para>
Expand Down Expand Up @@ -44,7 +44,31 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
&return.true.always;
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
This function now always returns &true;. Previously it returned &false; on failure.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>

Expand Down
30 changes: 27 additions & 3 deletions reference/mysqli/mysqli/debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
&reftitle.description;
<para>&style.oop;</para>
<methodsynopsis role="mysqli">
<modifier>public</modifier> <type>bool</type><methodname>mysqli::debug</methodname>
<modifier>public</modifier> <type>true</type><methodname>mysqli::debug</methodname>
<methodparam><type>string</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>&style.procedural;</para>
<methodsynopsis>
<type>bool</type><methodname>mysqli_debug</methodname>
<type>true</type><methodname>mysqli_debug</methodname>
<methodparam><type>string</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
Expand Down Expand Up @@ -108,7 +108,31 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true;.
&return.true.always;
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
This function now always returns &true;. Previously it returned &false; on failure.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>

Expand Down
6 changes: 3 additions & 3 deletions reference/mysqli/mysqli/ssl-set.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
&reftitle.description;
<para>&style.oop;</para>
<methodsynopsis role="mysqli">
<modifier>public</modifier> <type>bool</type><methodname>mysqli::ssl_set</methodname>
<modifier>public</modifier> <type>true</type><methodname>mysqli::ssl_set</methodname>
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>key</parameter></methodparam>
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>certificate</parameter></methodparam>
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>ca_certificate</parameter></methodparam>
Expand All @@ -20,7 +20,7 @@
</methodsynopsis>
<para>&style.procedural;</para>
<methodsynopsis>
<type>bool</type><methodname>mysqli_ssl_set</methodname>
<type>true</type><methodname>mysqli_ssl_set</methodname>
<methodparam><type>mysqli</type><parameter>mysql</parameter></methodparam>
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>key</parameter></methodparam>
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>certificate</parameter></methodparam>
Expand Down Expand Up @@ -89,7 +89,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This function always returns &true; value. If SSL setup is
&return.true.always; If SSL setup is
incorrect <function>mysqli_real_connect</function> will return an error
when you attempt to connect.
</para>
Expand Down
30 changes: 27 additions & 3 deletions reference/mysqli/mysqli_stmt/close.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
&reftitle.description;
<para>&style.oop;</para>
<methodsynopsis role="mysqli_stmt">
<modifier>public</modifier> <type>bool</type><methodname>mysqli_stmt::close</methodname>
<modifier>public</modifier> <type>true</type><methodname>mysqli_stmt::close</methodname>
<void/>
</methodsynopsis>
<para>&style.procedural;</para>
<methodsynopsis>
<type>bool</type><methodname>mysqli_stmt_close</methodname>
<type>true</type><methodname>mysqli_stmt_close</methodname>
<methodparam><type>mysqli_stmt</type><parameter>statement</parameter></methodparam>
</methodsynopsis>
<para>
Expand All @@ -39,7 +39,31 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
&return.true.always;
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
This function now always returns &true;. Previously it returned &false; on failure.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>

Expand Down
5 changes: 2 additions & 3 deletions reference/network/functions/closelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>closelog</methodname>
<type>true</type><methodname>closelog</methodname>
<void/>
</methodsynopsis>
<para>
Expand All @@ -26,7 +26,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
&return.true.always;
</para>
</refsect1>

Expand All @@ -41,7 +41,6 @@
</refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
Loading