A string whose value is computed lazily by a callback.
- Full name:
\Symfony\Component\String\LazyString
- This class implements:
\Stringable
,\JsonSerializable
private \Closure|string $value
public static fromCallable(callable|array $callback, mixed $arguments): static
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$callback |
callable|array | A callable or a [Closure, method] lazy-callable |
$arguments |
mixed |
public static fromStringable(string|int|float|bool|\Stringable $value): static
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$value |
string|int|float|bool|\Stringable |
Tells whether the provided value can be cast to string.
final public static isStringable(mixed $value): bool
-
This method is static.
-
This method is final.
Parameters:
Parameter | Type | Description |
---|---|---|
$value |
mixed |
Casts scalars and stringable objects to strings.
final public static resolve(\Stringable|string|int|float|bool $value): string
-
This method is static.
-
This method is final.
Parameters:
Parameter | Type | Description |
---|---|---|
$value |
\Stringable|string|int|float|bool |
public __toString(): string
public __sleep(): array
public jsonSerialize(): string
private __construct(): mixed
private static getPrettyName(callable $callback): string
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$callback |
callable |