Automattic\WooCommerce\Vendor\GraphQL\Utils

PhpDoc::nonEmptyOrNullprotected staticWC 1.0

Method of the class: PhpDoc{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = PhpDoc::nonEmptyOrNull( $maybeEmptyString ): ?string;
$maybeEmptyString(string) (required)
.

PhpDoc::nonEmptyOrNull() code WC 10.9.1

protected static function nonEmptyOrNull(string $maybeEmptyString): ?string
{
    $trimmed = trim($maybeEmptyString);

    return $trimmed === ''
        ? null
        : $trimmed;
}