1 | <?php |
||
10 | class GenerateRefreshTokenCommand extends Command |
||
11 | { |
||
12 | /** |
||
13 | * @var string the OAuth2 scope for the AdWords API |
||
14 | * @see https://developers.google.com/adwords/api/docs/guides/authentication#scope |
||
15 | */ |
||
16 | const ADWORDS_API_SCOPE = 'https://www.googleapis.com/auth/adwords'; |
||
17 | /** |
||
18 | * @var string the Google OAuth2 authorization URI for OAuth2 requests |
||
19 | * @see https://developers.google.com/identity/protocols/OAuth2InstalledApp#formingtheurl |
||
20 | */ |
||
21 | const AUTHORIZATION_URI = 'https://accounts.google.com/o/oauth2/v2/auth'; |
||
22 | /** |
||
23 | * @var string the redirect URI for OAuth2 installed application flows |
||
24 | * @see https://developers.google.com/identity/protocols/OAuth2InstalledApp#formingtheurl |
||
25 | */ |
||
26 | const REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob'; |
||
27 | /** |
||
28 | * Console command signature |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $signature = 'adwords:token'; |
||
33 | /** |
||
34 | * Description |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $description = 'Generate a new refresh token for Google Ads API'; |
||
39 | |||
40 | public function handle() |
||
88 | |||
89 | |||
90 | /** |
||
91 | * Configuration |
||
92 | * |
||
93 | * @return bool|array |
||
94 | */ |
||
95 | private function config() |
||
104 | } |
An exit expression should only be used in rare cases. For example, if you write a short command line script.
In most cases however, using an
exit
expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.