parameters = $parametersSource; } /** * @param string $name * @param mixed $default * @return mixed */ protected function getParam($name, $default = null) { return array_key_exists($name, $this->parameters) ? $this->parameters[$name] : $default; } /** * @param string $name * @param mixed $value */ public function setParam($name, $value) { $this->parameters[$name] = $value; } /** * @param string[] $params * @return bool */ public function hasParam(array $params) { foreach ($params as $p) { if (!array_key_exists($p, $this->parameters)) return false; } return true; } }