protected function validateRequiredParameters(array $required, array $params)
    {
        foreach ($required as $param) {
            if (!isset($params[$param])) {
                throw new MissingArgumentException(sprintf('The "%s" parameter is required.', $param));
            }
        }
    }
protected function validateRequiredParameters(array $required, array $params)
    {
        foreach ($required as $param) {
            if (!isset($params[$param])) {
                throw new MissingArgumentException(sprintf('The "%s" parameter is required.', $param));
            }
        }
    }
protected function validateRequiredParameters ( array $ required , array $ params ) { foreach ( $ required as $ param ) { if ( ! isset ( $ params [ $ param ] ) ) { throw new MissingArgumentException ( sprintf ( 'The "%s" parameter is required.' , $ param ) ) ; } } }
Validate parameters array

@param string[] $required required properties (array keys)
@param array $params   array to check for existence of the required keys

@throws MissingArgumentException if a required parameter is missing
Validate parameters array