@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @param $timePeriod |
103 | 103 | * @param null $fileLocation |
104 | 104 | * |
105 | - * @return array|string |
|
105 | + * @return string |
|
106 | 106 | */ |
107 | 107 | public function get(array $columns, $name = 'GeoLocationPerformanceReport', $timePeriod = ReportTimePeriod::LastWeek, $fileLocation = null) |
108 | 108 | { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | /** |
159 | 159 | * @param $reportRequest |
160 | - * @param $name |
|
160 | + * @param string $name |
|
161 | 161 | * @param $downloadFile |
162 | 162 | * |
163 | 163 | * @return string |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * of minutes. You should stop polling and try again later if the request |
283 | 283 | * is taking longer than an hour. |
284 | 284 | * |
285 | - * @param $reportRequestId |
|
285 | + * @param string $reportRequestId |
|
286 | 286 | * |
287 | 287 | * @return string ReportRequestStatus |
288 | 288 | */ |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * |
317 | 317 | * @param string $file zipFile we want to open |
318 | 318 | * |
319 | - * @return array of extracted files |
|
319 | + * @return Client of extracted files |
|
320 | 320 | */ |
321 | 321 | private function openZipFile($file, $delete = false) |
322 | 322 | { |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | /** |
410 | 410 | * @param array $array |
411 | 411 | * @param string $separator |
412 | - * @param null $enclosure |
|
412 | + * @param string $enclosure |
|
413 | 413 | * |
414 | 414 | * @return string |
415 | 415 | */ |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function setConfig($config) |
78 | 78 | { |
79 | 79 | $this->config = $config; |
80 | - $this->config['cache_dir'] = $this->config['cache_dir'] . '/' . 'BingAdsApiBundle'; //<-- important for the cache clear function |
|
80 | + $this->config['cache_dir'] = $this->config['cache_dir'].'/'.'BingAdsApiBundle'; //<-- important for the cache clear function |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | public function setApiDetails($refreshToken, $clientId, $secret, $redirectUri, $devToken) |
@@ -249,16 +249,16 @@ discard block |
||
249 | 249 | if ($incrementTime) { |
250 | 250 | switch ($count) { |
251 | 251 | case 31: // after 5 minutes |
252 | - $sleep = (1*60); |
|
252 | + $sleep = (1 * 60); |
|
253 | 253 | break; |
254 | 254 | case 35: // after 10 minutes |
255 | - $sleep = (5*60); |
|
255 | + $sleep = (5 * 60); |
|
256 | 256 | break; |
257 | 257 | case 40: // after 30 minutes |
258 | - $sleep = (15*60); |
|
258 | + $sleep = (15 * 60); |
|
259 | 259 | break; |
260 | 260 | case 44: // after 1,5 hours |
261 | - $sleep = (30*60); |
|
261 | + $sleep = (30 * 60); |
|
262 | 262 | break; |
263 | 263 | } |
264 | 264 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | } |
268 | 268 | |
269 | 269 | if ($reportRequestStatus->Status == "Error") { |
270 | - throw new Exceptions\ReportRequestErrorException("The request failed. Try requesting the report later.\nIf the request continues to fail, contact support.", $reportRequestStatus->Status, $reportRequestId ); |
|
270 | + throw new Exceptions\ReportRequestErrorException("The request failed. Try requesting the report later.\nIf the request continues to fail, contact support.", $reportRequestStatus->Status, $reportRequestId); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | return $reportRequestStatus; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | $totalLines = count($lines); |
373 | 373 | $removeFrom = $totalLines - $noOfLinesToRemove; |
374 | 374 | |
375 | - for( $i = $removeFrom; $i < $totalLines; $i++ ) { |
|
375 | + for ($i = $removeFrom; $i < $totalLines; $i++) { |
|
376 | 376 | unset($lines[$i]); |
377 | 377 | } |
378 | 378 | return $lines; |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | private function fixDate(array $lines, $separator = ',', $enclosure = '"') |
389 | 389 | { |
390 | 390 | foreach ($lines as $key => $line) { |
391 | - $columns = str_getcsv($line, $separator ); |
|
391 | + $columns = str_getcsv($line, $separator); |
|
392 | 392 | $isChanged = false; |
393 | 393 | foreach ($columns as $columnKey => $column) |
394 | 394 | { |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $isChanged = true; |
400 | 400 | } |
401 | 401 | } |
402 | - if ($isChanged){ |
|
402 | + if ($isChanged) { |
|
403 | 403 | $lines[$key] = $this->arrayToCsvLine($columns, $separator, $enclosure); |
404 | 404 | } |
405 | 405 | } |
@@ -417,15 +417,15 @@ discard block |
||
417 | 417 | { |
418 | 418 | $csvStr = ""; |
419 | 419 | |
420 | - for( $i = 0; $i < count($array); $i++ ) { |
|
420 | + for ($i = 0; $i < count($array); $i++) { |
|
421 | 421 | |
422 | 422 | if ($enclosure) { |
423 | - $csvStr .= $enclosure . str_replace($enclosure, $enclosure.$enclosure, $array[$i]) . $enclosure; |
|
423 | + $csvStr .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $array[$i]).$enclosure; |
|
424 | 424 | } else { |
425 | 425 | $csvStr .= $array[$i]; |
426 | 426 | } |
427 | 427 | |
428 | - $csvStr .= ($i < count($array) - 1) ? $separator : "\r\n" ; |
|
428 | + $csvStr .= ($i < count($array) - 1) ? $separator : "\r\n"; |
|
429 | 429 | } |
430 | 430 | return $csvStr; |
431 | 431 | } |
@@ -487,8 +487,8 @@ discard block |
||
487 | 487 | { |
488 | 488 | $error = $e->detail->AdApiFaultDetail->Errors->AdApiError; |
489 | 489 | } else if (isset($e->detail->ApiFaultDetail)) { |
490 | - if (!empty($e->detail->ApiFaultDetail->BatchErrors)){ |
|
491 | - $error = $error =$e->detail->ApiFaultDetail->Errors->AdApiError; |
|
490 | + if (!empty($e->detail->ApiFaultDetail->BatchErrors)) { |
|
491 | + $error = $error = $e->detail->ApiFaultDetail->Errors->AdApiError; |
|
492 | 492 | } elseif (!empty($e->detail->ApiFaultDetail->OperationErrors)) { |
493 | 493 | $error = $e->detail->ApiFaultDetail->OperationErrors->OperationError; |
494 | 494 | } |
@@ -26,8 +26,8 @@ |
||
26 | 26 | $loader->load('services.yml'); |
27 | 27 | |
28 | 28 | // Once the services definition are read, get your service and add a method call to setConfig() |
29 | - $sillyServiceDefintion = $container->getDefinition( 'werkspot.bing_ads_api_client' ); |
|
30 | - $sillyServiceDefintion->addMethodCall( 'setConfig', [ $config ] ); |
|
29 | + $sillyServiceDefintion = $container->getDefinition('werkspot.bing_ads_api_client'); |
|
30 | + $sillyServiceDefintion->addMethodCall('setConfig', [$config]); |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 |