src/Common.php
final public static function extract_kwargs(
		array $input_array, array $init_array
	) {
		foreach (array_keys($init_array) as $key) {
			if (isset($input_array[$key]))
				$init_array[$key] = $input_array[$key];
		}
		return $init_array;
	}
final public static function extract_kwargs(
		array $input_array, array $init_array
	) {
		foreach (array_keys($init_array) as $key) {
			if (isset($input_array[$key]))
				$init_array[$key] = $input_array[$key];
		}
		return $init_array;
	}
final public static function extract_kwargs ( array $ input_array , array $ init_array ) { foreach ( array_keys ( $ init_array ) as $ key ) { if ( isset ( $ input_array [ $ key ] ) ) $ init_array [ $ key ] = $ input_array [ $ key ] ; } return $ init_array ; }
Initiate a kwargs array for safe extraction.

This will remove keys not available in $init_array instead
of filling in holes in input array.

@param array $input_array Input array, typically first
parameter in a method.
@param array $init_array Fallback array when input array
is not complete, of the form: `key => default value`.
@return array A complete array ready to be extract()ed.
Initiate a kwargs array for safe extraction .