public function findConnection(string $name=null)
  {
    if ( empty($name) ) {
      # Take first available connection
      $connection = \reset($this->connections);
      if ($connection === false)
        return null;
    } else {
      # Attempt to find the connection from the pool
      $connection = ( $this->connections[\strtolower($name)] ?? null);
    }

    return $connection;
  }
public function findConnection(string $name=null)
  {
    if ( empty($name) ) {
      # Take first available connection
      $connection = \reset($this->connections);
      if ($connection === false)
        return null;
    } else {
      # Attempt to find the connection from the pool
      $connection = ( $this->connections[\strtolower($name)] ?? null);
    }

    return $connection;
  }
public function findConnection ( string $ name = null ) { if ( empty ( $ name ) ) { # Take first available connection $ connection = \ reset ( $ this -> connections ) ; if ( $ connection === false ) return null ; } else { # Attempt to find the connection from the pool $ connection = ( $ this -> connections [ \ strtolower ( $ name ) ] ?? null ) ; } return $ connection ; }
Find a connection in the pool

If the $name is empty/null we'll return the 1st connection in the internal
connection list (if there is one)

@param      string  $name   Name of the connection (from Config)

@return     null    | PdoConnection
Find a connection in the pool