AbstractAdapter::loadString

@param string $string

@return bool
336731
public function loadString($string)
    {
        $this->string = htmlspecialchars_decode($string);

        return (bool)empty($this->string);
    }
966845
public static function stringToValue($string)
	{
		if($string == '')
		{
			return $string;
		}
		if(is_float($string))
		{
			return (float) $string;
		}
		if(is_int($string))
		{
			return (int) $string;
		}
		if(strtolower($string) == 'true')
		{
			return true;
		}
		if(strtolower($string) == 'false')
		{
			return false;
		}
		if(strtolower($string) == 'null')
		{
			return NULL;
		}
		
		return $string;
	}
23537
public function loadString(&$string): array
    {
        /** @noinspection CallableParameterUseCaseInTypeContextInspection */
        $string = $this->unwrap($string);
        $this->rawSegments = $string;

        return $this->parse($string);
    }
95584
public function write($string)
    {
        $converted = $this->converter->convert($string, $this->stringCharset, $this->streamCharset);
        $written = $this->converter->getLength($converted, $this->streamCharset);
        $this->position += $written;
        return $this->stream->write($converted);
    }
1117436
public function parseString($string, $values)
    {
        $positions = [];
        $pos = 0;
        $offset = 0;

        while (($pos = strpos($string, "?", $offset)) !== false) {
            $positions[] = $pos;
            $offset = $pos + 1;
        }

        $count = count($positions);

        if ($count == 1) {
            $values = array($values);
        }

        for ($i = 0; $i < $count; $i++) {
            $value = $values[$i];
            if ($value instanceof Query) {
                $value = $this->parseValueQuery($value);
            } elseif (is_array($value)) {
                foreach ($value as $key => $subvalue) {
                    if (trim($subvalue) != '') {
                        $value[$key] = is_numeric($subvalue) ? $subvalue : $this->getQuery()->getManager()->getAdapter()->quote($subvalue);
                    } else {
                        unset($value[$key]);
                    }
                }
                $value = "(" . implode(", ", $value) . ")";
            } elseif (is_numeric($value)) {
            } else {
                $value = $this->getQuery()->getManager()->getAdapter()->quote($values[$i]);
            }
            $string = substr_replace($string, $value, strpos($string, '?'), 1);
        }

        return $string;
    }
1053072
public function has($string)
    {
        $lowercase = strtolower($string);

        if (!parent::has($lowercase) && !JFactory::getLanguage()->hasKey($string))
        {
            if (isset($this->_aliases[$lowercase])) {
                $key = $this->_aliases[$lowercase];
            }
            elseif (substr($string, 0, strlen($this->getPrefix())) === $this->getPrefix()) {
                $key = $string;
            } else {
                //Gets a key from the catalogue and prefixes it
                $key = $this->getPrefix().$this->generateKey($string);
            }

            $result = JFactory::getLanguage()->hasKey($key);
        }
        else $result = true;

        return $result;
    }
1201625
public static function fromString($string)
    {
        if (preg_match(self::PATTERN_FROM_STRING, trim($string), $matches)) {
            if (2 === count($matches)) {
                // whole number
                return new self((int) $matches[1]);
            } else {
                // either x y/z or x/y
                if ($matches[2]) {
                    // x y/z
                    $whole = new self((int) $matches[1]);

                    return $whole->add(new self(
                        (int) $matches[2],
                        (int) $matches[3]
                    ));
                }

                // x/y
                return new self((int) $matches[1], (int) $matches[3]);
            }
        }

        throw new InvalidArgumentException(sprintf(
            'Cannot parse "%s"',
            $string
        ));
    }
935605
public function setString($string)
	{
		if (null === $string)
		{
			throw new Exception('The string cannot be null.');
		}

		$this->string = $string;
		$this->hash   = md5($string);

		$this->convertHash();

		return $this;
	}
1165483
public function read($string)
	{
		if ( ! is_string($string)) {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, string, to be a string"
			);	
		}
		
		// fake the snippet as a "root" group
		$string = '{'.$string.'}';
		
		// instantiate the string's chunker and stream
		$chunker = new \Jstewmc\Chunker\Text($string);
		$stream  = new \Jstewmc\Stream\Stream($chunker);	
		
		// lex the stream
		$tokens  = (new Lexer())->lex($stream);
		
		// parse and render the tokens
		$group = (new Renderer())->render((new Parser())->parse($tokens));
		
		// set the snippet's properties from the group
		$this->parent     = null;
		$this->children   = $group->getChildren();
		$this->style      = $group->getStyle();
		$this->isRendered = true;
		
		return (bool) $group;
	}
1243973
private function unserialize($string)
    {
        if (false === $string || null === $string || '' === $string) {
            throw new \InvalidArgumentException('Unable to unserialize value.');
        }
        set_error_handler(
            function () {
                restore_error_handler();
                throw new \InvalidArgumentException('Unable to unserialize value, string is corrupted.');
            },
            E_NOTICE
        );
        $result = unserialize($string);
        restore_error_handler();

        return $result;
    }
1083480
public static function __getInstance($string)
    {
        $engine = self::detectBank($string);
        $engine->loadString($string);

        return $engine;
    }
1356948
public static function isEmpty($string)
	{
		if (is_array($string) || is_object($string))
		{
			return empty($string);
		}

		$string = (string) $string;

		return !(boolean) strlen($string);
	}
82054
public function readString($string)
    {
        if (!is_string($string))
            throw new IniReadingException('The expected type is string');

        // PHP 5.3.3, an empty line return is needed at the end.
        $string .= "\n";

        $data = @parse_ini_string($string, true);
        if ($data === false) {
            $e = error_get_last();
            throw new IniReadingException('Syntax error in INI configuration: ' . $e['message']);
        }

        $rawValues = @parse_ini_string($string, true, INI_SCANNER_RAW);

        return $this->toCollection($this->decode($data, $rawValues));
    }
606172
public function eat($string)
    {
        $state = $this->captureState();
        if ($string === $this->read(strlen($string), true)) {
            return true;
        } else {
            $state->restore();

            return false;
        }
    }
969793
public function findCacheByString(string $string)
    {

        // Check if already in cache
        if (!$this->isCachedByString($string)) {
            return null;
        }

        return $this->cacheByString[$string];
    }
668840
public function load($xmlString)
    {
        $data   =  $this->parserXml($xmlString);

        if (!isset($data['MsgType'])) {
            throw new \RuntimeException("can not found MsgType");
        }

        // event message
        if (WxReceive::MSG_TYPE_EVENT == $data['MsgType']) {
            $parser = new Event\Parser();
            return $parser->load($data);
        }

        // other message
        $parser = new Message\Parser();
        return $parser->load($data);
    }
1023083
function fromString( $string )
    {
        $dataType = $this->dataType();
        if ( $dataType )
            return $dataType->fromString( $this, $string );
        else
            return false;
    }