File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public function handle()
4141 {
4242 if (!$ config = $ this ->config ()) {
4343 $ this ->error ('Please provide a valid configuration. ' );
44- exit ;
44+ return false ;
4545 }
4646
4747 $ clientId = $ config ['client_id ' ];
@@ -56,29 +56,32 @@ public function handle()
5656 'clientSecret ' => $ clientSecret ,
5757 'scope ' => $ scopes
5858 ]);
59+
5960 $ this ->info ("Please sign in to your AdWords account, and open following url: \n" );
6061 $ this ->line (sprintf (
6162 "%s " ,
6263 $ oauth2 ->buildFullAuthorizationUri ([
6364 'access_type ' => 'offline ' ,
6465 ])
6566 ));
66- // Retrieve token
67+
6768 $ accessToken = $ this ->ask ('Insert your access token ' );
68- // Fetch auth token
69+
6970 try {
7071 $ oauth2 ->setCode ($ accessToken );
7172 $ authToken = $ oauth2 ->fetchAuthToken ();
7273 } catch (Exception $ exception ) {
7374 $ this ->error ($ exception ->getMessage ());
74- exit ;
75+ return false ;
7576 }
77+
7678 if (!isset ($ authToken )) {
7779 $ this ->error ('Error fetching the refresh token ' );
78- exit ;
80+ return false ;
7981 }
82+
8083 $ this ->comment ('Insert the refresh token in your adwords configuration file (config/adwords-targeting-idea-service.php) ' );
81- // Print refresh token
84+
8285 $ this ->info (sprintf (
8386 'Refresh token: "%s" ' ,
8487 $ authToken ['refresh_token ' ]
Original file line number Diff line number Diff line change 5151
5252 /*
5353 |--------------------------------------------------------------------------
54- | LOGGING
54+ | Logging - Level
5555 |--------------------------------------------------------------------------
5656 |
5757 | http://www.php-fig.org/psr/psr-3/#psrlogloglevel
You can’t perform that action at this time.
0 commit comments