protected function validateAllowedParameters(array $allowed, $params, $paramName)
    {
        if (!is_array($params)) {
            $params = array($params);
        }

        foreach ($params as $param) {
            if (!in_array($param, $allowed)) {
                throw new InvalidArgumentException(sprintf(
                    'The "%s" parameter may contain only values within "%s". "%s" given.',
                    $paramName,
                    implode(", ", $allowed),
                    $param
                ));
            }
        }

        return $params;
    }
protected function validateAllowedParameters(array $allowed, $params, $paramName)
    {
        if (!is_array($params)) {
            $params = array($params);
        }

        foreach ($params as $param) {
            if (!in_array($param, $allowed)) {
                throw new InvalidArgumentException(sprintf(
                    'The "%s" parameter may contain only values within "%s". "%s" given.',
                    $paramName,
                    implode(", ", $allowed),
                    $param
                ));
            }
        }

        return $params;
    }
protected function validateAllowedParameters ( array $ allowed , $ params , $ paramName ) { if ( ! is_array ( $ params ) ) { $ params = array ( $ params ) ; } foreach ( $ params as $ param ) { if ( ! in_array ( $ param , $ allowed ) ) { throw new InvalidArgumentException ( sprintf ( 'The "%s" parameter may contain only values within "%s". "%s" given.' , $ paramName , implode ( ", " , $ allowed ) , $ param ) ) ; } } return $ params ; }
Validate allowed parameters array
Checks whether the passed parameters are allowed

@param string[]        $allowed allowed properties
@param array|string $params  array to check
@param string $paramName

@return array array of validated parameters

@throws InvalidArgumentException if a parameter is not allowed
Validate allowed parameters array Checks whether the passed parameters are allowed