function StringLiteral::setFormat
Sets string format
Parameters
string $format Format, one of the format constants:
Return value
$this
2 calls to StringLiteral::setFormat()
- StringLiteral::setRaw in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Node/ StringLiteral.php - Sets node's raw value
- StringLiteral::setValue in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Node/ StringLiteral.php - Sets node's value
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Node/ StringLiteral.php, line 109
Class
- StringLiteral
- A node that represents a string literal.
Namespace
Peast\Syntax\NodeCode
public function setFormat($format) {
$this->format = $format;
$quote = $format === self::SINGLE_QUOTED ? "'" : '"';
$this->raw = Utils::quoteLiteralString($this->value, $quote);
return $this;
}