You are here

class CSSSnippet in Picture Background Formatter 8

Hierarchy

Expanded class hierarchy of CSSSnippet

1 file declares its use of CSSSnippet
PictureBackgroundFormatter.php in src/Plugin/Field/FieldFormatter/PictureBackgroundFormatter.php

File

src/Component/Render/CSSSnippet.php, line 7

Namespace

Drupal\picture_background_formatter\Component\Render
View source
class CSSSnippet implements MarkupInterface {

  /**
   * The string to escape.
   *
   * @var string
   */
  protected $string;

  /**
   * Constructs an HtmlEscapedText object.
   *
   * @param $string
   *   The string to escape. This value will be cast to a string.
   */
  public function __construct($string) {
    $this->string = (string) $string;
  }

  /**
   * {@inheritdoc}
   */
  public function __toString() {
    return $this->string;
  }

  /**
   * {@inheritdoc}
   */
  public function jsonSerialize() {
    return $this
      ->__toString();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CSSSnippet::$string protected property The string to escape.
CSSSnippet::jsonSerialize public function
CSSSnippet::__construct public function Constructs an HtmlEscapedText object.
CSSSnippet::__toString public function Returns markup. Overrides MarkupInterface::__toString