code: public function connect()
      {
          if($this->credentials instanceof AppCredentials)
          {
              //set application specific connection
              $this->connection = new AppConnection($this->credentials);
  
              return $this->connection;
          }
          else
          {
              //set User specific connection
              $this->connection = new UserConnection($this->credentials);
  
              return $this->connection;
          }
      }
docs: Checks the type of $credentials (if App or User) and returns a new connection instance accordingly.
  
  @return AppConnection|UserConnection Type of connection to Twitter.