Automattic\WooCommerce\Vendor\GraphQL\Utils
PhpDoc::unpad
Method of the class: PhpDoc{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = PhpDoc::unpad( $docBlock ): ?string;
- $docBlock(string|false|null) (required)
- .
PhpDoc::unpad() PhpDoc::unpad code WC 10.9.1
public static function unpad($docBlock): ?string
{
if ($docBlock === false || $docBlock === null) {
return null;
}
$lines = explode("\n", $docBlock);
$lines = array_map(
static fn (string $line): string => ' ' . trim($line),
$lines
);
$content = implode("\n", $lines);
return static::nonEmptyOrNull($content);
}