protected function convertToStringOrBoolean($string)
    {
        $result = (string) $string;
        $lowerString = strtolower($result);

        if('true' === $lowerString)
        {
            $result = true;
        }
        elseif('false' === $lowerString)
        {
            $result = false;
        }

        return $result;
    }
protected function convertToStringOrBoolean($string)
    {
        $result = (string) $string;
        $lowerString = strtolower($result);

        if('true' === $lowerString)
        {
            $result = true;
        }
        elseif('false' === $lowerString)
        {
            $result = false;
        }

        return $result;
    }
protected function convertToStringOrBoolean ( $ string ) { $ result = ( string ) $ string ; $ lowerString = strtolower ( $ result ) ; if ( 'true' === $ lowerString ) { $ result = true ; } elseif ( 'false' === $ lowerString ) { $ result = false ; } return $ result ; }
Cast to string or to a boolean value if the string contains a true or false

@param mixed $string

@return boolean|string
Cast to string or to a boolean value if the string contains a true or false