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

Breadcrumb

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

function LazyString::fromStringable

File

vendor/symfony/string/LazyString.php, line 52

Class

LazyString
A string whose value is computed lazily by a callback.

Namespace

Symfony\Component\String

Code

public static function fromStringable(string|int|float|bool|\Stringable $value) : static {
    if (\is_object($value)) {
        return static::fromCallable($value->__toString(...));
    }
    $lazyString = new static();
    $lazyString->value = (string) $value;
    return $lazyString;
}

API Navigation

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