public function offsetSet($name, $value) { if (!$value instanceof Connection) { throw new InvalidArgumentException('$value is not a Connection object.'); } $this->conns[$name] = $value; }