if ( is_object( $text ) ) {
throw new InvalidArgumentException( '$text must be a string.' );
} elseif ( !is_string( $text ) ) {
if ( is_object( $text ) ) {
throw new InvalidArgumentException( '$text must be a string.' );
} elseif ( !is_string( $text ) ) {