@@ -56,7 +56,7 @@ |
||
| 56 | 56 | protected function checkMaximumDateRange(Carbon $fromDate, Carbon $toDate, $maxDays = 31) |
| 57 | 57 | { |
| 58 | 58 | if ($fromDate->diffInDays($toDate) > $maxDays) { |
| 59 | - throw ApiException::resultError('The maximum date range between from_date and to_date is '.$maxDays.' days.'); |
|
| 59 | + throw ApiException::resultError('The maximum date range between from_date and to_date is ' . $maxDays . ' days.'); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | } while ($response['resultsreturned'] < $response['totalresults']); |
| 38 | 38 | |
| 39 | 39 | |
| 40 | - $rankings = $rankings->transform(function ($ranking, $key) { |
|
| 40 | + $rankings = $rankings->transform(function($ranking, $key) { |
|
| 41 | 41 | return new StatKeywordRanking([ |
| 42 | 42 | 'date' => $ranking['date'], |
| 43 | 43 | 'google' => new StatKeywordEngineRanking([ |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $keywords = collect(); |
| 23 | 23 | |
| 24 | 24 | do { |
| 25 | - $response = $this->performQuery('keywords/list', ['site_id' => $siteID, 'start' => $start, 'results' => 5000 ]); |
|
| 25 | + $response = $this->performQuery('keywords/list', ['site_id' => $siteID, 'start' => $start, 'results' => 5000]); |
|
| 26 | 26 | $start += 5000; |
| 27 | 27 | |
| 28 | 28 | if ($response['totalresults'] == 0) { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } while ($response['resultsreturned'] < $response['totalresults']); |
| 42 | 42 | |
| 43 | 43 | |
| 44 | - $keywords = $keywords->transform(function ($keyword, $key) { |
|
| 44 | + $keywords = $keywords->transform(function($keyword, $key) { |
|
| 45 | 45 | return $this->transformListedKeyword($keyword); |
| 46 | 46 | }); |
| 47 | 47 | |
@@ -63,15 +63,15 @@ discard block |
||
| 63 | 63 | $arguments['market'] = $market; |
| 64 | 64 | $arguments['device'] = $device; |
| 65 | 65 | $arguments['type'] = 'regular'; |
| 66 | - $arguments['keyword'] = implode(',', array_map(function ($el) { |
|
| 66 | + $arguments['keyword'] = implode(',', array_map(function($el) { |
|
| 67 | 67 | return str_replace(',', '\,', $el); |
| 68 | 68 | }, $keywords)); |
| 69 | 69 | |
| 70 | - if (! is_null($tags) && count($tags) > 0) { |
|
| 70 | + if (!is_null($tags) && count($tags) > 0) { |
|
| 71 | 71 | $arguments['tag'] = implode(',', $tags); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (! is_null($location) && $location != '') { |
|
| 74 | + if (!is_null($location) && $location != '') { |
|
| 75 | 75 | $arguments['location'] = $location; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $keywords = collect($response['Result']); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return $keywords->transform(function ($keyword, $key) { |
|
| 91 | + return $keywords->transform(function($keyword, $key) { |
|
| 92 | 92 | return $this->transformCreatedKeyword($keyword); |
| 93 | 93 | }); |
| 94 | 94 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
| 115 | - return collect($response['Result'])->transform(function ($keywordID, $key) { |
|
| 115 | + return collect($response['Result'])->transform(function($keywordID, $key) { |
|
| 116 | 116 | return $keywordID['Id']; |
| 117 | 117 | }); |
| 118 | 118 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | if (is_null($keyword['KeywordStats'])) { |
| 159 | 159 | $modifiedKeyword->keyword_stats = null; |
| 160 | 160 | } else { |
| 161 | - $localTrends = collect($keyword['KeywordStats']['LocalSearchTrendsByMonth'])->map(function ($searchVolume, $month) { |
|
| 161 | + $localTrends = collect($keyword['KeywordStats']['LocalSearchTrendsByMonth'])->map(function($searchVolume, $month) { |
|
| 162 | 162 | return new StatLocalSearchTrend([ |
| 163 | 163 | 'month' => strtolower($month), |
| 164 | 164 | 'search_volume' => ($searchVolume == '-') ? null : $searchVolume, |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | return collect(); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - $tags = collect($response['Result'])->transform(function ($item, $key) { |
|
| 24 | + $tags = collect($response['Result'])->transform(function($item, $key) { |
|
| 25 | 25 | if ($item['Keywords'] == 'none') { |
| 26 | 26 | $item['Keywords'] = collect(); |
| 27 | 27 | } else { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $rankDistribution = collect([$response['RankDistribution']]); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $rankDistribution->transform(function ($distribution, $key) { |
|
| 60 | + $rankDistribution->transform(function($distribution, $key) { |
|
| 61 | 61 | return $this->transformRankDistribution($distribution); |
| 62 | 62 | }); |
| 63 | 63 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | } while ($response['resultsreturned'] < $response['totalresults']); |
| 29 | 29 | |
| 30 | 30 | |
| 31 | - $sites->transform(function ($site, $key) { |
|
| 31 | + $sites->transform(function($site, $key) { |
|
| 32 | 32 | return new StatSite([ |
| 33 | 33 | 'id' => $site['Id'], |
| 34 | 34 | 'project_id' => $site['ProjectId'], |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $sites = collect($response['Result']); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $sites->transform(function ($site, $key) use ($projectID) { |
|
| 70 | + $sites->transform(function($site, $key) use ($projectID) { |
|
| 71 | 71 | return new StatSite([ |
| 72 | 72 | 'id' => $site['Id'], |
| 73 | 73 | 'project_id' => $projectID, |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $rankDistribution = collect([$response['RankDistribution']]); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - $rankDistribution->transform(function ($distribution, $key) { |
|
| 106 | + $rankDistribution->transform(function($distribution, $key) { |
|
| 107 | 107 | return $this->transformRankDistribution($distribution); |
| 108 | 108 | }); |
| 109 | 109 | |
@@ -163,6 +163,6 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | $response = $this->performQuery('sites/delete', ['id' => $siteID]); |
| 165 | 165 | |
| 166 | - return (int) $response['Result']['Id']; |
|
| 166 | + return (int)$response['Result']['Id']; |
|
| 167 | 167 | } |
| 168 | 168 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | $subaccounts = collect(); |
| 21 | 21 | |
| 22 | - if (! isset($response['User'])) { |
|
| 22 | + if (!isset($response['User'])) { |
|
| 23 | 23 | return $subaccounts; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $subaccounts = collect($response['User']); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - $subaccounts->transform(function ($item, $key) { |
|
| 32 | + $subaccounts->transform(function($item, $key) { |
|
| 33 | 33 | return new StatSubAccount([ |
| 34 | 34 | 'id' => $item['Id'], |
| 35 | 35 | 'login' => $item['Login'], |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $bulkJobs = collect($response['Result']); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - return $bulkJobs->transform(function ($job, $key) { |
|
| 39 | + return $bulkJobs->transform(function($job, $key) { |
|
| 40 | 40 | return new StatBulkJob([ |
| 41 | 41 | 'id' => $job['Id'], |
| 42 | 42 | 'job_type' => $job['JobType'], |
@@ -70,16 +70,16 @@ discard block |
||
| 70 | 70 | $arguments['currently_tracked_only'] = $currentlyTrackedOnly; |
| 71 | 71 | $arguments['crawled_keywords_only'] = $crawledKeywordsOnly; |
| 72 | 72 | |
| 73 | - if (! is_null($sites) && count($sites) > 0) { |
|
| 73 | + if (!is_null($sites) && count($sites) > 0) { |
|
| 74 | 74 | $arguments['site_id'] = implode(',', $sites); |
| 75 | 75 | ; |
| 76 | 76 | } |
| 77 | - if (! is_null($engines) && count($engines) > 0) { |
|
| 77 | + if (!is_null($engines) && count($engines) > 0) { |
|
| 78 | 78 | $arguments['engines'] = implode(',', $engines); |
| 79 | 79 | } |
| 80 | 80 | $response = $this->performQuery('bulk/ranks', $arguments); |
| 81 | 81 | |
| 82 | - return (int) $response['Result']['Id']; |
|
| 82 | + return (int)$response['Result']['Id']; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | public function status($bulkJobID) |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $jobStatus->sites = collect(); |
| 96 | 96 | if (isset($response['Result']['SiteId'])) { |
| 97 | 97 | $jobStatus->sites = collect(explode(',', $response['Result']['SiteId'])) |
| 98 | - ->transform(function ($site, $key) { |
|
| 98 | + ->transform(function($site, $key) { |
|
| 99 | 99 | return (int)$site; |
| 100 | 100 | }); |
| 101 | 101 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $response = $this->performQuery('bulk/delete', ['id' => $bulkJobID]); |
| 115 | 115 | |
| 116 | - return (int) $response['Result']['Id']; |
|
| 116 | + return (int)$response['Result']['Id']; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | public function siteRankingDistributions($date) |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $this->validateBulkDate($date); |
| 122 | 122 | |
| 123 | 123 | $response = $this->performQuery('bulk/site_ranking_distributions', ['date' => $date->toDateString()]); |
| 124 | - return (int) $response['Result']['Id']; |
|
| 124 | + return (int)$response['Result']['Id']; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | public function tagRankingDistributions($date) |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $this->validateBulkDate($date); |
| 130 | 130 | |
| 131 | 131 | $response = $this->performQuery('bulk/tag_ranking_distributions', ['date' => $date->toDateString()]); |
| 132 | - return (int) $response['Result']['Id']; |
|
| 132 | + return (int)$response['Result']['Id']; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | public function get($bulkJobID) |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | { |
| 162 | 162 | $projects = $this->getCollection($bulkStream['Project']); |
| 163 | 163 | |
| 164 | - $projects->transform(function ($project, $key) { |
|
| 164 | + $projects->transform(function($project, $key) { |
|
| 165 | 165 | return $this->transformProject($project); |
| 166 | 166 | }); |
| 167 | 167 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | if ($project['TotalSites'] > 1) { |
| 186 | 186 | $transformedProject->sites = collect($project['Site']); |
| 187 | 187 | } |
| 188 | - $transformedProject->sites->transform(function ($site, $key) { |
|
| 188 | + $transformedProject->sites->transform(function($site, $key) { |
|
| 189 | 189 | return $this->transformSite($site); |
| 190 | 190 | }); |
| 191 | 191 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $transformedSite->created_at = $site['CreatedAt']; |
| 203 | 203 | |
| 204 | 204 | if (array_key_exists('Keyword', $site)) { |
| 205 | - $transformedSite->keywords = collect($site['Keyword'])->transform(function ($keyword, $key) { |
|
| 205 | + $transformedSite->keywords = collect($site['Keyword'])->transform(function($keyword, $key) { |
|
| 206 | 206 | return $this->transformKeyword($keyword); |
| 207 | 207 | }); |
| 208 | 208 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | if (array_key_exists('Tag', $site)) { |
| 215 | - $transformedSite->tags = $this->getCollection($site['Tag'])->transform(function ($tag, $key) { |
|
| 215 | + $transformedSite->tags = $this->getCollection($site['Tag'])->transform(function($tag, $key) { |
|
| 216 | 216 | return $this->transformTag($tag); |
| 217 | 217 | }); |
| 218 | 218 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | if (is_null($keyword['KeywordStats'])) { |
| 241 | 241 | $modifiedKeyword->keyword_stats = null; |
| 242 | 242 | } else { |
| 243 | - $localTrends = collect($keyword['KeywordStats']['LocalSearchTrendsByMonth'])->map(function ($searchVolume, $month) { |
|
| 243 | + $localTrends = collect($keyword['KeywordStats']['LocalSearchTrendsByMonth'])->map(function($searchVolume, $month) { |
|
| 244 | 244 | return new StatLocalSearchTrend([ |
| 245 | 245 | 'month' => strtolower($month), |
| 246 | 246 | 'search_volume' => ($searchVolume == '-') ? null : $searchVolume, |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | $rankings = $this->getCollection($rankingForEngine['Result'], 'Rank'); |
| 292 | 292 | |
| 293 | - $rankings->transform(function ($ranking, $key) { |
|
| 293 | + $rankings->transform(function($ranking, $key) { |
|
| 294 | 294 | return $this->transformRanking($ranking); |
| 295 | 295 | }); |
| 296 | 296 | |