Improve bool <-> string conversion functions docs

These functions are polymorphic towards their input types to be more useful in more cases. Change the documentation to reflect this fact.
This commit is contained in:
Anton Timmermans 2020-09-13 13:01:14 +02:00 committed by GitHub
parent 9bdafbeb18
commit 723f14e44a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ defined( 'ABSPATH' ) || exit;
* Converts a string (e.g. 'yes' or 'no') to a bool.
*
* @since 3.0.0
* @param string $string String to convert.
* @param string|bool $string String to convert. If a bool is passed it will be returned as-is.
* @return bool
*/
function wc_string_to_bool( $string ) {
@ -25,7 +25,7 @@ function wc_string_to_bool( $string ) {
* Converts a bool to a 'yes' or 'no'.
*
* @since 3.0.0
* @param bool $bool String to convert.
* @param bool|string $bool Bool to convert. If a string is passed it will first be converted to a bool.
* @return string
*/
function wc_bool_to_string( $bool ) {