@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Hborras\TwitterAdsSDK\TwitterAds\TailoredAudience; |
4 | 4 | |
5 | 5 | use Hborras\TwitterAdsSDK\TwitterAds; |
6 | -use Hborras\TwitterAdsSDK\TwitterAds\Account; |
|
7 | 6 | use Hborras\TwitterAdsSDK\TwitterAds\Batch; |
8 | 7 | |
9 | 8 | /** |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $line = fgets($file); |
30 | 30 | $normalized_email = strtolower(trim($line, " \t\r\n\0\x0B.")); |
31 | 31 | $normalized_email = hash('sha256', $normalized_email); |
32 | - fwrite($newFile, $normalized_email . "\n"); |
|
32 | + fwrite($newFile, $normalized_email."\n"); |
|
33 | 33 | # do same stuff with the $line |
34 | 34 | } |
35 | 35 | fclose($newFile); |
@@ -26,4 +26,4 @@ |
||
26 | 26 | |
27 | 27 | // create request for a simple nullcasted tweet |
28 | 28 | $media = $twitterAds->upload(['media' => 'twitter-gif.gif', 'media_type' => 'image/gif'], true); |
29 | -$tweet = Tweet::create($account, 'Tweet with chunked upload GIF...' . rand() . ' http://twitter.com', ['media_ids' => $media->media_id]); |
|
30 | 29 | \ No newline at end of file |
30 | +$tweet = Tweet::create($account, 'Tweet with chunked upload GIF...'.rand().' http://twitter.com', ['media_ids' => $media->media_id]); |
|
31 | 31 | \ No newline at end of file |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | // create request for a simple nullcasted tweet |
48 | 48 | $media = $twitterAds->upload(['media' => 'kitten.jpg']); |
49 | -$tweet1 = Tweet::create($account, 'Tweet number 1 ...' . rand() . ' http://twitter.com', ['media_ids' => $media->media_id]); |
|
49 | +$tweet1 = Tweet::create($account, 'Tweet number 1 ...'.rand().' http://twitter.com', ['media_ids' => $media->media_id]); |
|
50 | 50 | |
51 | 51 | // promote the tweet using our line item |
52 | 52 | $promotedTweet = new PromotedTweet($account); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // create request for a nullcasted tweet with a website card |
58 | 58 | $websiteCard = new WebsiteCard($account); |
59 | 59 | $websiteCard = $websiteCard->all()->next(); |
60 | -$status = 'Tweet number 2 ...' . rand() . $websiteCard->getPreviewUrl(); |
|
60 | +$status = 'Tweet number 2 ...'.rand().$websiteCard->getPreviewUrl(); |
|
61 | 61 | |
62 | 62 | $tweet2 = Tweet::create($account, $status); |
63 | 63 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | /** Create a video entity and save it*/ |
32 | 32 | $video = new Video($account); |
33 | -$video->setTitle("Test Video " . rand()); |
|
34 | -$video->setDescription("Description" . rand()); |
|
33 | +$video->setTitle("Test Video ".rand()); |
|
34 | +$video->setDescription("Description".rand()); |
|
35 | 35 | $video->setVideoMediaId($media->media_id); |
36 | 36 | $video->save(); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | $output = ''; |
18 | 18 | if (is_array($input)) { |
19 | - $output = array_map([__NAMESPACE__ . '\Util', 'urlencodeRfc3986'], $input); |
|
19 | + $output = array_map([__NAMESPACE__.'\Util', 'urlencodeRfc3986'], $input); |
|
20 | 20 | } elseif (is_scalar($input)) { |
21 | 21 | $output = rawurlencode($input); |
22 | 22 | } |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | // June 12th, 2010 - changed to sort because of issue 164 by hidetaka |
105 | 105 | sort($value, SORT_STRING); |
106 | 106 | foreach ($value as $duplicateValue) { |
107 | - $pairs[] = $parameter . '=' . $duplicateValue; |
|
107 | + $pairs[] = $parameter.'='.$duplicateValue; |
|
108 | 108 | } |
109 | 109 | } else { |
110 | - $pairs[] = $parameter . '=' . $value; |
|
110 | + $pairs[] = $parameter.'='.$value; |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function setTimeouts($connectionTimeout, $timeout) |
36 | 36 | { |
37 | - $this->connectionTimeout = (int)$connectionTimeout; |
|
38 | - $this->timeout = (int)$timeout; |
|
37 | + $this->connectionTimeout = (int) $connectionTimeout; |
|
38 | + $this->timeout = (int) $timeout; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function setDecodeJsonAsArray($value) |
45 | 45 | { |
46 | - $this->decodeJsonAsArray = (bool)$value; |
|
46 | + $this->decodeJsonAsArray = (bool) $value; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function setUserAgent($userAgent) |
53 | 53 | { |
54 | - $this->userAgent = (string)$userAgent; |
|
54 | + $this->userAgent = (string) $userAgent; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -37,7 +37,7 @@ |
||
37 | 37 | { |
38 | 38 | $endTime = isset($params[AnalyticsFields::END_TIME]) ? $params[AnalyticsFields::END_TIME] : new \DateTime('now'); |
39 | 39 | $endTime->setTime($endTime->format('H'), 0, 0); |
40 | - $startTime = isset($params[AnalyticsFields::START_TIME]) ? $params[AnalyticsFields::START_TIME] : new \DateTime($endTime->format('c') . " - 7 days"); |
|
40 | + $startTime = isset($params[AnalyticsFields::START_TIME]) ? $params[AnalyticsFields::START_TIME] : new \DateTime($endTime->format('c')." - 7 days"); |
|
41 | 41 | $startTime->setTime($startTime->format('H'), 0, 0); |
42 | 42 | $granularity = isset($params[AnalyticsFields::GRANULARITY]) ? $params[AnalyticsFields::GRANULARITY] : Enumerations::GRANULARITY_TOTAL; |
43 | 43 | $placement = isset($params[AnalyticsFields::PLACEMENT]) ? $params[AnalyticsFields::PLACEMENT] : Enumerations::PLACEMENT_ALL_ON_TWITTER; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $postData = $this->toPostdata(); |
179 | 179 | $out = $this->getNormalizedHttpUrl(); |
180 | 180 | if ($postData) { |
181 | - $out .= '?' . $postData; |
|
181 | + $out .= '?'.$postData; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | return $out; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | throw new TwitterOAuthException('Arrays not supported in headers'); |
214 | 214 | } |
215 | 215 | $out .= ($first) ? ' ' : ', '; |
216 | - $out .= Util::urlencodeRfc3986($k) . '="' . Util::urlencodeRfc3986($v) . '"'; |
|
216 | + $out .= Util::urlencodeRfc3986($k).'="'.Util::urlencodeRfc3986($v).'"'; |
|
217 | 217 | $first = false; |
218 | 218 | } |
219 | 219 | |
@@ -257,6 +257,6 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public static function generateNonce() |
259 | 259 | { |
260 | - return md5(microtime() . mt_rand()); |
|
260 | + return md5(microtime().mt_rand()); |
|
261 | 261 | } |
262 | 262 | } |