\Symfony\Component\StringLazyString

A string whose value is computed lazily by a callback.

Summary

Methods
Properties
Constants
fromCallable()
fromStringable()
isStringable()
resolve()
__toString()
__sleep()
jsonSerialize()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
getPrettyName()
$value
N/A

Properties

$value

$value

Methods

fromCallable()

fromCallable(callable|array  $callback, mixed  ...$arguments) : static

Parameters

callable|array $callback

A callable or a [Closure, method] lazy-callable

mixed $arguments variadic

Returns

static —

fromStringable()

fromStringable(string|int|float|bool|\Stringable  $value) : static

Parameters

string|int|float|bool|\Stringable $value

Returns

static —

isStringable()

isStringable(mixed  $value) : bool

Tells whether the provided value can be cast to string.

Parameters

mixed $value

Returns

bool —

resolve()

resolve(object|string|int|float|bool  $value) : string

Casts scalars and stringable objects to strings.

Parameters

object|string|int|float|bool $value

Throws

\TypeError

When the provided value is not stringable

Returns

string —

__toString()

__toString() : string

Returns

string —

__sleep()

__sleep() : array

Returns

array —

jsonSerialize()

jsonSerialize() : string

Returns

string —

__construct()

__construct() : mixed

Returns

mixed —

getPrettyName()

getPrettyName(callable  $callback) : string

Parameters

callable $callback

Returns

string —