Issues (63)

google_drive/gClient.php (4 issues)

1
<?php
2
/** 
3
 * Copyright 2018 Social Manager.
4
 * PHP version 7.2.8
5
 *
6
 * It will Zip the file
7
 * 
8
 * @category Album_Manager
9
 * @package  Google
10
 * @author   Kishan Jasani <[email protected]>
11
 * @license  https://fbrtchallenge.tk/privacy_policy/privacy_policy.php 
12
 * @link     ""
13
 * 
14
 * You are hereby granted a non-exclusive, worldwide, royalty-free license to
15
 * use, copy, modify, and distribute this software in source code or binary
16
 * form for use in connection with the web services and APIs provided by
17
 * Kishan Jasani.
18
 *
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND
20
 */
21
require_once __DIR__.'/../vendor/autoload.php';
22
session_start();
23
/**
24
 * Create a google Client for move album to Drive
25
 */
26
27
class CreateGoogleClient
28
{
29
    /**
30
     * Create a google Client for move album to Drive
31
     * 
32
     * @return $client
0 ignored issues
show
Documentation Bug introduced by
The doc comment $client at position 0 could not be parsed: Unknown type name '$client' at position 0 in $client.
Loading history...
33
     */
34
    function createClient()
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
35
    {
36
        $client = new Google_Client();
37
        $client->setAuthConfigFile('../client_secret.json');
0 ignored issues
show
Deprecated Code introduced by
The function Google_Client::setAuthConfigFile() has been deprecated. ( Ignorable by Annotation )

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

37
        /** @scrutinizer ignore-deprecated */ $client->setAuthConfigFile('../client_secret.json');
Loading history...
38
        $client->setAccessType("offline");
39
        $client->setIncludeGrantedScopes(true);
40
        $client->addScope(Google_Service_Drive::DRIVE);
41
        return $client;
42
    }
43
}
44
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
45