code: public function getConnection($name = null): Connection
      {
          $this->loadConnections();
  
          $name = $name ?? $this->getDefaultConnectionName();
  
          if (!isset($this->connections[$name])) {
              throw new \InvalidArgumentException(sprintf('Missing connection with name "%s".', $name));
          }
  
          return $this->connections[$name];
      }
docs: @param string|null $name
  
  @return Connection
  
  @throws \InvalidArgumentException