Automattic\WooCommerce\Internal\Caches

VersionStringGenerator::validate_inputprivateWC 1.0

Validate ID input.

Method of the class: VersionStringGenerator{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->validate_input( $id ): void;
$id(string) (required)
The ID to validate.

VersionStringGenerator::validate_input() code WC 10.4.3

private function validate_input( string $id ): void {
	if ( '' === $id ) {
		throw new \InvalidArgumentException( 'ID cannot be empty.' );
	}
}