public function add(FormType $_type, $_options) { static $added = array(); $item = FormType::computeItem($_type, $_options); if (array_key_exists("name", $item)) { if (isset($added[$item["name"]])) { throw new \InvalidArgumentException("Name '{$item["name"]}' already exists!"); } $added[$item["name"]] = true; } $item["type"] = $_type; $this->items[] = $item; }