Completed
Push — master ( 74685b...ebe2a0 )
by Felix
37s
created
src/Api/StatSites.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         } while ($response['resultsreturned'] < $response['totalresults']);
32 32
 
33 33
 
34
-        $sites->transform(function ($site) {
34
+        $sites->transform(function($site) {
35 35
             return new StatSite([
36 36
                 'id' => $site['Id'],
37 37
                 'project_id' => $site['ProjectId'],
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $sites = collect($response['Result']);
71 71
         }
72 72
 
73
-        $sites->transform(function ($site) use ($projectID) {
73
+        $sites->transform(function($site) use ($projectID) {
74 74
             return new StatSite([
75 75
                 'id' => $site['Id'],
76 76
                 'project_id' => $projectID,
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             $rankDistribution = collect([$response['RankDistribution']]);
107 107
         }
108 108
 
109
-        $rankDistribution->transform(function ($distribution) {
109
+        $rankDistribution->transform(function($distribution) {
110 110
             return $this->transformRankDistribution($distribution);
111 111
         });
112 112
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $response = $this->performQuery('sites/delete', ['id' => $siteID]);
188 188
 
189
-        return (int)$response['Result']['Id'];
189
+        return (int) $response['Result']['Id'];
190 190
     }
191 191
 
192 192
     /**
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
         } while ($response['resultsreturned'] < $response['totalresults']);
212 212
 
213 213
 
214
-        $sovSites->transform(function ($sov) {
214
+        $sovSites->transform(function($sov) {
215 215
 
216 216
             $shareOfVoice = new StatShareOfVoice([
217 217
                 'date' => $sov['date'],
218
-                'sites' => collect($sov['Site'])->transform(function ($site) {
218
+                'sites' => collect($sov['Site'])->transform(function($site) {
219 219
                     return new StatShareOfVoiceSite([
220 220
                         'domain' => $site['Domain'],
221 221
                         'share' => (float) $site['Share'],
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     {
240 240
         $response = $this->performQuery('sites/most_frequent_domains', ['id' => $siteID, 'engine' => $engine]);
241 241
 
242
-        $domains = collect($response['Site'])->transform(function ($site) {
242
+        $domains = collect($response['Site'])->transform(function($site) {
243 243
             return new StatFrequentDomain([
244 244
                 'domain'           => array_get($site, 'Domain'),
245 245
                 'top_ten_results'  => array_get($site, 'TopTenResults'),
Please login to merge, or discard this patch.
src/Api/StatTags.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $tags = collect($response['Result']);
35 35
         }
36 36
 
37
-        $tags = $tags->transform(function ($item, $key) {
37
+        $tags = $tags->transform(function($item, $key) {
38 38
             if ($item['Keywords'] == 'none') {
39 39
                 $item['Keywords'] = collect();
40 40
             } else {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $rankDistribution = collect([$response['RankDistribution']]);
71 71
         }
72 72
 
73
-        $rankDistribution->transform(function ($distribution, $key) {
73
+        $rankDistribution->transform(function($distribution, $key) {
74 74
             return $this->transformRankDistribution($distribution);
75 75
         });
76 76
 
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
         } while ($response['resultsreturned'] < $response['totalresults']);
100 100
 
101 101
 
102
-        $sovSites->transform(function ($sov) {
102
+        $sovSites->transform(function($sov) {
103 103
 
104 104
             $shareOfVoice = new StatShareOfVoice([
105 105
                 'date' => $sov['date'],
106
-                'sites' => collect($sov['Site'])->transform(function ($site) {
106
+                'sites' => collect($sov['Site'])->transform(function($site) {
107 107
                     return new StatShareOfVoiceSite([
108 108
                         'domain' => $site['Domain'],
109 109
                         'share' => (float) $site['Share'],
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $response = $this->performQuery('tags/most_frequent_domains', ['id' => $tagID, 'engine' => $engine]);
129 129
 
130
-        $domains = collect($response['Site'])->transform(function ($site) {
130
+        $domains = collect($response['Site'])->transform(function($site) {
131 131
             return new StatFrequentDomain([
132 132
                 'domain'           => array_get($site, 'Domain'),
133 133
                 'top_ten_results'  => array_get($site, 'TopTenResults'),
Please login to merge, or discard this patch.
src/Api/StatBilling.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -115,11 +115,11 @@
 block discarded – undo
115 115
         $statBillSummary = new StatBillSummary([
116 116
             'start_date'             => $response['Summary']['StartDate'],
117 117
             'end_date'               => $response['Summary']['EndDate'],
118
-            'min_committed_charge'   => (float)array_get($response, 'Summary.MinCommittedCharge', 0.0),
119
-            'tracked_keywords'       => (int)$response['Summary']['TrackedKeywords'],
120
-            'tracked_keywords_total' => (float)$response['Summary']['TrackedKeywordsTotal'],
121
-            'optional_service_total' => (float)$response['Summary']['OptionalServiceTotal'],
122
-            'total'                  => (float)$response['Summary']['Total'],
118
+            'min_committed_charge'   => (float) array_get($response, 'Summary.MinCommittedCharge', 0.0),
119
+            'tracked_keywords'       => (int) $response['Summary']['TrackedKeywords'],
120
+            'tracked_keywords_total' => (float) $response['Summary']['TrackedKeywordsTotal'],
121
+            'optional_service_total' => (float) $response['Summary']['OptionalServiceTotal'],
122
+            'total'                  => (float) $response['Summary']['Total'],
123 123
         ]);
124 124
 
125 125
         return $statBillSummary;
Please login to merge, or discard this patch.
src/Api/StatBulk.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $bulkJobs = collect($response['Result']);
35 35
         }
36 36
 
37
-        return $bulkJobs->transform(function ($job, $key) {
37
+        return $bulkJobs->transform(function($job, $key) {
38 38
             return $this->transformBulkJobStatus($job);
39 39
         });
40 40
     }
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
         $arguments['currently_tracked_only'] = $currentlyTrackedOnly;
60 60
         $arguments['crawled_keywords_only'] = $crawledKeywordsOnly;
61 61
 
62
-        if (! is_null($sites) && count($sites) > 0) {
62
+        if (!is_null($sites) && count($sites) > 0) {
63 63
             $arguments['site_id'] = implode(',', $sites);
64 64
             ;
65 65
         }
66
-        if (! is_null($engines) && count($engines) > 0) {
66
+        if (!is_null($engines) && count($engines) > 0) {
67 67
             $arguments['engines'] = implode(',', $engines);
68 68
         }
69 69
         $response = $this->performQuery('bulk/ranks', $arguments);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         $response = $this->performQuery('bulk/delete', ['id' => $bulkJobID]);
84 84
 
85
-        return (int)$response['Result']['Id'];
85
+        return (int) $response['Result']['Id'];
86 86
     }
87 87
 
88 88
     public function siteRankingDistributions($date)
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $this->validateBulkDate($date);
91 91
 
92 92
         $response = $this->performQuery('bulk/site_ranking_distributions', ['date' => $date->toDateString()]);
93
-        return (int)$response['Result']['Id'];
93
+        return (int) $response['Result']['Id'];
94 94
     }
95 95
 
96 96
     public function tagRankingDistributions($date)
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $projects = $this->getCollection($bulkStream['Project']);
132 132
 
133
-        $projects->transform(function ($project, $key) {
133
+        $projects->transform(function($project, $key) {
134 134
             return $this->transformProject($project);
135 135
         });
136 136
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         if ($project['TotalSites'] > 1) {
155 155
             $transformedProject->sites = collect($project['Site']);
156 156
         }
157
-        $transformedProject->sites->transform(function ($site, $key) {
157
+        $transformedProject->sites->transform(function($site, $key) {
158 158
             return $this->transformSite($site);
159 159
         });
160 160
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         $transformedSite->created_at = $site['CreatedAt'];
172 172
 
173 173
         if (array_key_exists('Keyword', $site)) {
174
-            $transformedSite->keywords = collect($site['Keyword'])->transform(function ($keyword, $key) {
174
+            $transformedSite->keywords = collect($site['Keyword'])->transform(function($keyword, $key) {
175 175
                 return $this->transformKeyword($keyword);
176 176
             });
177 177
         }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         }
182 182
 
183 183
         if (array_key_exists('Tag', $site)) {
184
-            $transformedSite->tags = $this->getCollection($site['Tag'])->transform(function ($tag, $key) {
184
+            $transformedSite->tags = $this->getCollection($site['Tag'])->transform(function($tag, $key) {
185 185
                 return $this->transformTag($tag);
186 186
             });
187 187
         }
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
         if (is_null($keyword['KeywordStats'])) {
210 210
             $modifiedKeyword->keyword_stats = null;
211 211
         } else {
212
-            $localTrends = collect($keyword['KeywordStats']['LocalSearchTrendsByMonth'])->map(function ($searchVolume, $month) {
212
+            $localTrends = collect($keyword['KeywordStats']['LocalSearchTrendsByMonth'])->map(function($searchVolume, $month) {
213 213
                 return new StatLocalSearchTrend([
214 214
                     'month' => strtolower($month),
215 215
                     'search_volume' => ($searchVolume == '-') ? null : $searchVolume,
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
         $rankings = $this->getCollection($rankingForEngine['Result'], 'Rank');
261 261
 
262
-        $rankings->transform(function ($ranking, $key) {
262
+        $rankings->transform(function($ranking, $key) {
263 263
             return $this->transformRanking($ranking);
264 264
         });
265 265
 
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
         $bulkJob->sites = collect();
313 313
         if (array_has($job, 'SiteId')) {
314 314
             $bulkJob->sites = collect(explode(',', $job['SiteId']))
315
-                ->transform(function ($site, $key) {
316
-                    return (int)$site;
315
+                ->transform(function($site, $key) {
316
+                    return (int) $site;
317 317
                 });
318 318
         }
319 319
         $bulkJob->status = $job['Status'];
Please login to merge, or discard this patch.