Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StringLiteral.php

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\Node

Code

public function setFormat($format) {
    $this->format = $format;
    $quote = $format === self::SINGLE_QUOTED ? "'" : '"';
    $this->raw = Utils::quoteLiteralString($this->value, $quote);
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal