public function ensureParameters($parameters = array(), $method) {
    if (empty($parameters) || empty($method)) {
      throw new MissingParameterException(sprintf('%s called without required parameters.', __METHOD__));
    }
    foreach ($parameters as $parameter => $value) {
      if (!isset($value)) {
        throw new MissingParameterException(sprintf('Missing required %s parameter in %s', $parameter, $method));
      }
    }
  }
public function ensureParameters($parameters = array(), $method) {
    if (empty($parameters) || empty($method)) {
      throw new MissingParameterException(sprintf('%s called without required parameters.', __METHOD__));
    }
    foreach ($parameters as $parameter => $value) {
      if (!isset($value)) {
        throw new MissingParameterException(sprintf('Missing required %s parameter in %s', $parameter, $method));
      }
    }
  }
public function ensureParameters ( $ parameters = array ( ) , $ method ) { if ( empty ( $ parameters ) || empty ( $ method ) ) { throw new MissingParameterException ( sprintf ( '%s called without required parameters.' , __METHOD__ ) ) ; } foreach ( $ parameters as $ parameter => $ value ) { if ( ! isset ( $ value ) ) { throw new MissingParameterException ( sprintf ( 'Missing required %s parameter in %s' , $ parameter , $ method ) ) ; } } }
Checks that required parameters were provided.

PHP only triggers a warning for missing parameters and continues with
program execution. To avoid calling the Pingdom API with known malformed
data, we throw an exception if we find that something required is missing.

@param array $parameters
An array of parameters to check, keyed by parameter name with the
parameter itself as the value.
@param string $method
The calling method's name.

@throws MissingParameterException
Checks that required parameters were provided .