protected function ensureParameter($name)
    {
        if (!isset($this->$name)) {
            throw new \InvalidArgumentException(get_class($this) . ' is missing parameter: ' . $name);
        }

        return $this->$name;
    }
protected function ensureParameter($name)
    {
        if (!isset($this->$name)) {
            throw new \InvalidArgumentException(get_class($this) . ' is missing parameter: ' . $name);
        }

        return $this->$name;
    }
protected function ensureParameter ( $ name ) { if ( ! isset ( $ this -> $ name ) ) { throw new \ InvalidArgumentException ( get_class ( $ this ) . ' is missing parameter: ' . $ name ) ; } return $ this -> $ name ; }
Ensure a parameter exists and return its value.

@param string $name The parameter name.

@return mixed

@throws \InvalidArgumentException When the parameter is missing.
Ensure a parameter exists and return its value .