lib/SiftClient.php
private function mergeArguments(&$opts, $defaults) {
        if (!is_array($opts)) {
            throw new InvalidArgumentException("Argument 'opts' must be an array.");
        }
        foreach ($opts as $key => $value) {
            if (!array_key_exists($key, $defaults)) {
                throw new InvalidArgumentException("${key} is not a valid argument.");
            }
        }
        $opts += $defaults;
    }
private function mergeArguments(&$opts, $defaults) {
        if (!is_array($opts)) {
            throw new InvalidArgumentException("Argument 'opts' must be an array.");
        }
        foreach ($opts as $key => $value) {
            if (!array_key_exists($key, $defaults)) {
                throw new InvalidArgumentException("${key} is not a valid argument.");
            }
        }
        $opts += $defaults;
    }
private function mergeArguments ( & $ opts , $ defaults ) { if ( ! is_array ( $ opts ) ) { throw new InvalidArgumentException ( "Argument 'opts' must be an array." ) ; } foreach ( $ opts as $ key => $ value ) { if ( ! array_key_exists ( $ key , $ defaults ) ) { throw new InvalidArgumentException ( "${key} is not a valid argument." ) ; } } $ opts += $ defaults ; }
Merges a function's default parameter values into an array of arguments.

In particular, this method:
1. Validates that $opts only contains allowed keys -- i.e., those in $defaults.
2. Modifies $opts in-place by $opts += $defaults.

@param array &$opts  The array of arguments passed to a function.

@param array $defaults  The array of default parameter values for a function.

@throws InvalidArgumentException if $opts contains any keys not in $defaults.
Merges a function s default parameter values into an array of arguments .