WP_CLI

Configurator::assoc_arg_to_runtime_configprivateWP-CLI 1.0

Handle turning an $assoc_arg into a runtime arg.

Method of the class: Configurator{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->assoc_arg_to_runtime_config( $key, $value, $runtime_config );
$key(required)
.
$value(required)
.
$runtime_config(required) (passed by reference — &)
.

Configurator::assoc_arg_to_runtime_config() code WP-CLI 2.13.0-alpha

private function assoc_arg_to_runtime_config( $key, $value, &$runtime_config ) {
	$details = $this->spec[ $key ];
	if ( isset( $details['deprecated'] ) ) {
		fwrite( STDERR, "WP-CLI: The --{$key} global parameter is deprecated. {$details['deprecated']}\n" );
	}

	if ( $details['multiple'] ) {
		$runtime_config[ $key ][] = $value;
	} else {
		$runtime_config[ $key ] = $value;
	}
}