Issues (994)

config-google.php (1 issue)

Labels
Severity
1
<?php
2
3
$google = null;
4
5
function google($offline = true)
6
{
7
  global $google;
8
  if (!$google) {
9
    $google = new Google\client();
10
    $google->setApplicationName('Client_Library_Examples');
11
    $google->setDeveloperKey(CONFIG['google']['key']);
12
    $google->setClientId(CONFIG['google']['client']);
13
    $google->setClientSecret(CONFIG['google']['secret']);
14
    $google->set_offline($offline)
0 ignored issues
show
The method set_offline() does not exist on Google\Client. It seems like you code against a sub-type of Google\Client such as GoogleExt\client. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
    $google->/** @scrutinizer ignore-call */ 
15
             set_offline($offline)
Loading history...
15
      ->set_scope([
16
        'https://www.googleapis.com/auth/youtube.readonly',
17
        'https://www.googleapis.com/auth/userinfo.email',
18
        'https://www.googleapis.com/auth/userinfo.profile',
19
        'https://www.googleapis.com/auth/drive',
20
        'https://www.googleapis.com/auth/youtube.force-ssl',
21
      ])
22
      ->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/google/callback');
23
  }
24
  return $google;
25
}
26