API / Minn\Support / Sprintf

Sprintf final class

Minn\Support\Sprintf · public/minn/src/Minn/Support/Sprintf.php · 46 lines

A pattern filled one fragment at a time, as wp_sprintf fills it: "%%" is a percent sign, each other fragment (a directive and the text up to the next one) takes the next argument or the one its position names, and $filter may write a fragment itself (the wp_sprintf filter: the list directive %l lives there); otherwise PHP's sprintf fills it, an array as nothing, and a fragment it cannot fill stays as written.

Public

staticformat(string $pattern, array $args, Closure $filter): string#

The pattern with its arguments filled in.

$argslist<mixed>
$filterClosure(string, mixed): mixedthe fragment and its argument in, the fragment as written out