public function validate() { foreach ($this->getRequiredFields() as $field) { if (empty($this->parameters[$field])) { throw new RuntimeException("{$field} can not be empty"); } } }