title: Fatal error: Class 'Response' not found
body: <p>I'm working with Abraham's <code>twitteroauth</code> to implement Twitter OAuth in my application. While running my application, this is the error I'm encountering:</p>
  
  <pre><code>Fatal error: Class 'Response' not found in /opt/lampp/htdocs/tmhOAuth-master/twitteroauth.php on line 108
  </code></pre>
  
  <p>Now, this is what my <code>twitteroauth.php</code> file looks like till the 108th line:</p>
  
  <pre><code>&lt;?php
  /**
   * The most popular PHP library for use with the Twitter OAuth REST API.
   *
   * @license MIT
   */
  //namespace twitteroauthm\src\TwitterOAuth;
  //use twitteroauthm\src\TwitterOAuth;
  use twitteroauthm\src\Util\JsonDecoder;
  
  require "twitteroauthm/autoload.php";
  use Abraham\TwitterOAuth\TwitterOAuth as Config;
  //require_once("twitteroauthm/src/TwitterOAuth.php");
  
  //use twitteroauthm\src\TwitterOAuth;
  
  //require_once("twitteroauthm/src/Config.php");
  
  /**
   * TwitterOAuth class for interacting with the Twitter API.
   *
   * @author Abraham Williams &lt;abraham@abrah.am&gt;
   */
  class TwitterOAuth extends Config
  {
      const API_VERSION = '1.1';
      const API_HOST = 'https://api.twitter.com';
      const UPLOAD_HOST = 'https://upload.twitter.com';
  
      /** @var Response details about the result of the last request */
      private $response;
      /** @var string|null Application bearer token */
      private $bearer;
      /** @var Consumer Twitter application details */
      private $consumer;
      /** @var Token|null User access token details */
      private $token;
      /** @var HmacSha1 OAuth 1 signature type used by Twitter */
      private $signatureMethod;
  
      /**
       * Constructor
       *
       * @param string      $consumerKey      The Application Consumer Key
       * @param string      $consumerSecret   The Application Consumer Secret
       * @param string|null $oauthToken       The Client Token (optional)
       * @param string|null $oauthTokenSecret The Client Token Secret (optional)
       */
      public function __construct($consumerKey, $consumerSecret, $oauthToken = null, $oauthTokenSecret = null)
      {
          $this-&gt;resetLastResponse();
          $this-&gt;signatureMethod = new HmacSha1();
          $this-&gt;consumer = new Consumer($consumerKey, $consumerSecret);
          if (!empty($oauthToken) &amp;&amp; !empty($oauthTokenSecret)) {
              $this-&gt;token = new Token($oauthToken, $oauthTokenSecret);
          }
          if (empty($oauthToken) &amp;&amp; !empty($oauthTokenSecret)) {
              $this-&gt;bearer = $oauthTokenSecret;
          }
      }
  
      /**
       * @param string $oauthToken
       * @param string $oauthTokenSecret
       */
      public function setOauthToken($oauthToken, $oauthTokenSecret)
      {
          $this-&gt;token = new Token($oauthToken, $oauthTokenSecret);
      }
  
      /**
       * @return string|null
       */
      public function getLastApiPath()
      {
          return $this-&gt;response-&gt;getApiPath();
      }
  
      /**
       * @return int
       */
      public function getLastHttpCode()
      {
          return $this-&gt;response-&gt;getHttpCode();
      }
  
      /**
       * @return array
       */
      public function getLastXHeaders()
      {
          return $this-&gt;response-&gt;getXHeaders();
      }
  
      /**
       * @return array|object|null
       */
      public function getLastBody()
      {
          return $this-&gt;response-&gt;getBody();
      }
  
      /**
       * Resets the last response cache.
       */
      public function resetLastResponse()
      {
          $this-&gt;response = new Response();
      }
  </code></pre>
  
  <p>What seems to be wrong with my code? Is there a way to include the <code>Response</code> class into my file that I'm not aware of? </p>
  
  <p>I'm also including a few screenshots to give an overview of my project's file structure:</p>
  
  <p><a href="https://i.stack.imgur.com/fT1av.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fT1av.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/M1o5b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M1o5b.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/kSsw8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kSsw8.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Z4S4a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z4S4a.png" alt="enter image description here"></a></p>