Automattic\WooCommerce\Vendor\GraphQL\Language

Printer::wrapprotected staticWC 1.0

If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.

Method of the class: Printer{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Printer::wrap( $start, ?string $maybeString, $end ): string;
$start(string) (required)
.
?string $maybeString(required)
.
$end(string)
.
Default: ''

Printer::wrap() code WC 10.9.1

protected static function wrap(string $start, ?string $maybeString, string $end = ''): string
{
    if ($maybeString === null || $maybeString === '') {
        return '';
    }

    return $start . $maybeString . $end;
}