Skip to content

Commit 9979bf8

Browse files
schulzefelixStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent aed8411 commit 9979bf8

File tree

6 files changed

+34
-32
lines changed

6 files changed

+34
-32
lines changed

src/AdWords.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace SchulzeFelix\AdWords;
44

5-
use Google\AdsApi\AdWords\v201705\o\AttributeType;
6-
use Google\AdsApi\AdWords\v201705\o\RequestType;
7-
use Google\AdsApi\AdWords\v201705\o\TargetingIdeaService;
8-
use Google\AdsApi\Common\Util\MapEntries;
95
use Illuminate\Support\Collection;
6+
use Google\AdsApi\Common\Util\MapEntries;
107
use SchulzeFelix\AdWords\Responses\Keyword;
8+
use Google\AdsApi\AdWords\v201705\o\RequestType;
9+
use Google\AdsApi\AdWords\v201705\o\AttributeType;
1110
use SchulzeFelix\AdWords\Responses\MonthlySearchVolume;
11+
use Google\AdsApi\AdWords\v201705\o\TargetingIdeaService;
1212

1313
class AdWords
1414
{

src/AdWordsService.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
namespace SchulzeFelix\AdWords;
44

5-
use Google\AdsApi\AdWords\v201705\cm\ApiException;
5+
use Google\AdsApi\AdWords\v201705\cm\Paging;
6+
use Google\AdsApi\AdWords\v201705\o\IdeaType;
67
use Google\AdsApi\AdWords\v201705\cm\Language;
78
use Google\AdsApi\AdWords\v201705\cm\Location;
9+
use Google\AdsApi\AdWords\v201705\cm\ApiException;
10+
use Google\AdsApi\AdWords\v201705\o\AttributeType;
811
use Google\AdsApi\AdWords\v201705\cm\NetworkSetting;
9-
use Google\AdsApi\AdWords\v201705\cm\Paging;
1012
use Google\AdsApi\AdWords\v201705\cm\RateExceededError;
11-
use Google\AdsApi\AdWords\v201705\o\AttributeType;
12-
use Google\AdsApi\AdWords\v201705\o\IdeaTextFilterSearchParameter;
13-
use Google\AdsApi\AdWords\v201705\o\IdeaType;
13+
use Google\AdsApi\AdWords\v201705\o\TargetingIdeaService;
14+
use Google\AdsApi\AdWords\v201705\o\TargetingIdeaSelector;
15+
use Google\AdsApi\AdWords\v201705\o\NetworkSearchParameter;
1416
use Google\AdsApi\AdWords\v201705\o\LanguageSearchParameter;
1517
use Google\AdsApi\AdWords\v201705\o\LocationSearchParameter;
16-
use Google\AdsApi\AdWords\v201705\o\NetworkSearchParameter;
18+
use Google\AdsApi\AdWords\v201705\o\IdeaTextFilterSearchParameter;
1719
use Google\AdsApi\AdWords\v201705\o\RelatedToQuerySearchParameter;
18-
use Google\AdsApi\AdWords\v201705\o\TargetingIdeaSelector;
19-
use Google\AdsApi\AdWords\v201705\o\TargetingIdeaService;
2020

2121
class AdWordsService
2222
{
@@ -123,7 +123,7 @@ private function getSearchParameters(array $keywords, $languageId, $locationId,
123123
$searchParameters = [];
124124

125125
//Create Language Parameter
126-
if (!is_null($languageId)) {
126+
if (! is_null($languageId)) {
127127
$languageParameter = new LanguageSearchParameter();
128128
$language = new Language();
129129
$language->setId($languageId);
@@ -132,7 +132,7 @@ private function getSearchParameters(array $keywords, $languageId, $locationId,
132132
}
133133

134134
//Create Location Parameter
135-
if (!is_null($locationId)) {
135+
if (! is_null($locationId)) {
136136
$locationParameter = new LocationSearchParameter();
137137
$location = new Location();
138138
$location->setId($locationId);
@@ -156,12 +156,12 @@ private function getSearchParameters(array $keywords, $languageId, $locationId,
156156
$relatedToQuerySearchParameter->setQueries($keywords);
157157
$searchParameters[] = $relatedToQuerySearchParameter;
158158

159-
if (!is_null($included) || !is_null($excluded)) {
159+
if (! is_null($included) || ! is_null($excluded)) {
160160
$ideaTextFilterSearchParameter = new IdeaTextFilterSearchParameter();
161-
if (!is_null($included)) {
161+
if (! is_null($included)) {
162162
$ideaTextFilterSearchParameter->setIncluded($included);
163163
}
164-
if (!is_null($excluded)) {
164+
if (! is_null($excluded)) {
165165
$ideaTextFilterSearchParameter->setExcluded($excluded);
166166
}
167167
$searchParameters[] = $ideaTextFilterSearchParameter;

src/AdWordsServiceFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace SchulzeFelix\AdWords;
44

5-
use Google\AdsApi\AdWords\AdWordsServices;
65
use Google\AdsApi\AdWords\AdWordsSession;
7-
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
8-
use Google\AdsApi\AdWords\v201705\o\TargetingIdeaService;
6+
use Google\AdsApi\AdWords\AdWordsServices;
97
use Google\AdsApi\Common\AdsLoggerFactory;
108
use Google\AdsApi\Common\OAuth2TokenBuilder;
9+
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
10+
use Google\AdsApi\AdWords\v201705\o\TargetingIdeaService;
1111

1212
class AdWordsServiceFactory
1313
{

src/AdWordsServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace SchulzeFelix\AdWords;
44

55
use Illuminate\Support\ServiceProvider;
6-
use SchulzeFelix\AdWords\Commands\GenerateRefreshTokenCommand;
76
use SchulzeFelix\AdWords\Exceptions\InvalidConfiguration;
7+
use SchulzeFelix\AdWords\Commands\GenerateRefreshTokenCommand;
88

99
class AdWordsServiceProvider extends ServiceProvider
1010
{
@@ -34,7 +34,6 @@ public function register()
3434
'command.adwords:token',
3535
]);
3636

37-
3837
$this->app->bind(AdWordsService::class, function () use ($adwordsConfig) {
3938
return AdWordsServiceFactory::createForConfig($adwordsConfig);
4039
});

src/Commands/GenerateRefreshTokenCommand.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,23 @@ class GenerateRefreshTokenCommand extends Command
2525
*/
2626
const REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob';
2727
/**
28-
* Console command signature
28+
* Console command signature.
2929
*
3030
* @var string
3131
*/
3232
protected $signature = 'adwords:token';
3333
/**
34-
* Description
34+
* Description.
3535
*
3636
* @var string
3737
*/
3838
protected $description = 'Generate a new refresh token for Google Ads API';
3939

4040
public function handle()
4141
{
42-
if (!$config = $this->config()) {
42+
if (! $config = $this->config()) {
4343
$this->error('Please provide a valid configuration.');
44+
4445
return false;
4546
}
4647

@@ -54,12 +55,12 @@ public function handle()
5455
'tokenCredentialUri' => CredentialsLoader::TOKEN_CREDENTIAL_URI,
5556
'clientId' => $clientId,
5657
'clientSecret' => $clientSecret,
57-
'scope' => $scopes
58+
'scope' => $scopes,
5859
]);
5960

6061
$this->info("Please sign in to your AdWords account, and open following url:\n");
6162
$this->line(sprintf(
62-
"%s",
63+
'%s',
6364
$oauth2->buildFullAuthorizationUri([
6465
'access_type' => 'offline',
6566
])
@@ -72,11 +73,13 @@ public function handle()
7273
$authToken = $oauth2->fetchAuthToken();
7374
} catch (Exception $exception) {
7475
$this->error($exception->getMessage());
76+
7577
return false;
7678
}
7779

78-
if (!isset($authToken)) {
80+
if (! isset($authToken)) {
7981
$this->error('Error fetching the refresh token');
82+
8083
return false;
8184
}
8285

@@ -88,19 +91,19 @@ public function handle()
8891
));
8992
}
9093

91-
9294
/**
93-
* Configuration
95+
* Configuration.
9496
*
9597
* @return bool|array
9698
*/
9799
private function config()
98100
{
99101
/** @var null|array $config */
100102
$config = config('adwords-targeting-idea-service');
101-
if (is_null($config) || !count($config)) {
103+
if (is_null($config) || ! count($config)) {
102104
return false;
103105
}
106+
104107
return $config;
105108
}
106109
}

tests/Integration/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace SchulzeFelix\AdWords\Tests\Integration;
44

5-
use Orchestra\Testbench\TestCase as Orchestra;
65
use SchulzeFelix\AdWords\AdWordsFacade;
6+
use Orchestra\Testbench\TestCase as Orchestra;
77
use SchulzeFelix\AdWords\AdWordsServiceProvider;
88

99
abstract class TestCase extends Orchestra

0 commit comments

Comments
 (0)