title: Undefined variable PDO
body: <p>I use PDO for the database connection. All the PDO stuff has been initialized in a file application_top.php.</p>
  
  <pre><code>if(!isset($db)) {
    $db = new Morrow\Db(array(
      'driver'   =&gt; 'mysql',
      'host'     =&gt; DB_SERVER,
      'db'       =&gt; DB_DATABASE,
      'user'     =&gt; DB_SERVER_USERNAME,
      'pass'     =&gt; DB_SERVER_PASSWORD,
      'encoding' =&gt; '"utf8"',
    ));
  }
  </code></pre>
  
  <p>This works fine. But PHPStorm gives me a warning </p>
  
  <blockquote>
    <p>Undefined variable 'db'</p>
  </blockquote>
  
  <p>The code looks like</p>
  
  <pre><code>require_once 'includes/application_top.php';
  ...
  $pass = $db-&gt;result_one("
    SELECT customers_password
    FROM   " . TABLE_CUSTOMERS . "
    WHERE  customers_id = " . (int)$_SESSION['customer_id']
  );
  </code></pre>
  
  <p>But why is $db undefined?</p>