title: Getting warnings when using the "list" method of Google Drive API using PHP
body: <p>We are using the Google Drive API for PHP in our web application, and although listing, inserting and deleting work just fine, we keep getting these warnings when using the <code>list()</code> method:</p>
  
  <pre><code>$google_return = $GoogleAPI['Drive']-&gt;files-&gt;list();
  </code></pre>
  
  <p>causes these two warnings to appear:</p>
  
  <pre><code>Warning: Invalid argument supplied for foreach() in (...)lib/php/GOOGLE/service/Google_ServiceResource.php on line 108
  Warning: Invalid argument supplied for foreach() in (...)lib/php/GOOGLE/io/Google_REST.php on line 92
  </code></pre>
  
  <p>I tried modifying the API files themselves and added an <code>is_array</code> check before that foreach, to no avail.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>
  
  <p>EDIT:
  The client API is downloaded from here
  <a href="http://code.google.com/p/google-api-php-client/" rel="nofollow">http://code.google.com/p/google-api-php-client/</a></p>
  
  <p>The below code causes a warning, so I added the <code>is_array</code> check but that didn't eliminate it.</p>
  
  <pre><code>$method['parameters'] = array_merge($method['parameters'], $this-&gt;stackParameters);
  if (is_array ($parameters) {
       foreach ($parameters as $key =&gt; $val) {
          if ($key != 'postBody' &amp;&amp; ! isset($method['parameters'][$key])) {
            throw new Google_Exception("($name) unknown parameter: '$key'");
          }
       }
  }
  </code></pre>