@@ -13,16 +13,16 @@ |
||
13 | 13 | |
14 | 14 | public function setTopTenResultsAttribute($value) |
15 | 15 | { |
16 | - return $this->attributes['top_ten_results'] = (int)$value; |
|
16 | + return $this->attributes['top_ten_results'] = (int) $value; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function setResultsAnalyzedAttribute($value) |
20 | 20 | { |
21 | - return $this->attributes['results_analyzed'] = (int)$value; |
|
21 | + return $this->attributes['results_analyzed'] = (int) $value; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function setCoverageAttribute($value) |
25 | 25 | { |
26 | - return $this->attributes['coverage'] = (float)$value; |
|
26 | + return $this->attributes['coverage'] = (float) $value; |
|
27 | 27 | } |
28 | 28 | } |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | $statBillSummary = new StatBillSummary([ |
118 | 118 | 'start_date' => $response['Summary']['StartDate'], |
119 | 119 | 'end_date' => $response['Summary']['EndDate'], |
120 | - 'min_committed_charge' => (float)array_get($response, 'Summary.MinCommittedCharge', 0.0), |
|
121 | - 'tracked_keywords' => (int)$response['Summary']['TrackedKeywords'], |
|
122 | - 'tracked_keywords_total' => (float)$response['Summary']['TrackedKeywordsTotal'], |
|
123 | - 'optional_service_total' => (float)$response['Summary']['OptionalServiceTotal'], |
|
124 | - 'total' => (float)$response['Summary']['Total'], |
|
120 | + 'min_committed_charge' => (float) array_get($response, 'Summary.MinCommittedCharge', 0.0), |
|
121 | + 'tracked_keywords' => (int) $response['Summary']['TrackedKeywords'], |
|
122 | + 'tracked_keywords_total' => (float) $response['Summary']['TrackedKeywordsTotal'], |
|
123 | + 'optional_service_total' => (float) $response['Summary']['OptionalServiceTotal'], |
|
124 | + 'total' => (float) $response['Summary']['Total'], |
|
125 | 125 | ]); |
126 | 126 | |
127 | 127 | return $statBillSummary; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | $services = new Collection(); |
133 | 133 | |
134 | - if(is_null($optionalServices['OptionalService'])){ |
|
134 | + if (is_null($optionalServices['OptionalService'])) { |
|
135 | 135 | return $services; |
136 | 136 | } |
137 | 137 |
@@ -31,7 +31,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'), |
@@ -34,7 +34,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $bulkJob->job_type = $job['JobType']; |
301 | 301 | $bulkJob->format = $job['Format']; |
302 | 302 | |
303 | - if(array_has($job, ['Project', 'Folder', 'SiteTitle', 'SiteUrl'])){ |
|
303 | + if (array_has($job, ['Project', 'Folder', 'SiteTitle', 'SiteUrl'])) { |
|
304 | 304 | $bulkJob->project = $job['Project']; |
305 | 305 | $bulkJob->folder = $job['Folder']; |
306 | 306 | $bulkJob->site_title = $job['SiteTitle']; |
@@ -312,8 +312,8 @@ discard block |
||
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']; |
@@ -34,7 +34,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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'), |