protected function clearUndefinedOptions(array $options, $allowUndefinedOptions)
    {
        if (! $allowUndefinedOptions) {

            return $options;
        }

        /* Find out undefined options by computing the difference between given and defined options. */
        $undefinedOptions = array_diff(
            array_keys($options),
            $this->getDefinedOptions()
        );

        /* Remove undefined options by computing the difference between given and undefined options. */

        return array_diff_key(
            $options,
            array_flip($undefinedOptions)
        );
    }
protected function clearUndefinedOptions(array $options, $allowUndefinedOptions)
    {
        if (! $allowUndefinedOptions) {

            return $options;
        }

        /* Find out undefined options by computing the difference between given and defined options. */
        $undefinedOptions = array_diff(
            array_keys($options),
            $this->getDefinedOptions()
        );

        /* Remove undefined options by computing the difference between given and undefined options. */

        return array_diff_key(
            $options,
            array_flip($undefinedOptions)
        );
    }
protected function clearUndefinedOptions ( array $ options , $ allowUndefinedOptions ) { if ( ! $ allowUndefinedOptions ) { return $ options ; } /* Find out undefined options by computing the difference between given and defined options. */ $ undefinedOptions = array_diff ( array_keys ( $ options ) , $ this -> getDefinedOptions ( ) ) ; /* Remove undefined options by computing the difference between given and undefined options. */ return array_diff_key ( $ options , array_flip ( $ undefinedOptions ) ) ; }
Clears undefined options before resolving, if the appropriate flag is set.

@param array $options               Map of option names to values.
@param bool  $allowUndefinedOptions If set to true undefined options will not raise an error.

@return array Clean options.
Clears undefined options before resolving if the appropriate flag is set .