function String_::fromString
Parameters
array<string, mixed> $attributes:
bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes:
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Node/ Scalar/ String_.php, line 49
Class
Namespace
PhpParser\Node\ScalarCode
public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = true) : self {
$attributes['kind'] = $str[0] === "'" || $str[1] === "'" && ($str[0] === 'b' || $str[0] === 'B') ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED;
$attributes['rawValue'] = $str;
$string = self::parse($str, $parseUnicodeEscape);
return new self($string, $attributes);
}