Completed
Branch master (e695c5)
by Hector
03:00
created
examples/analytics.php 2 patches
Unused Use Statements   -6 removed lines patch added patch discarded remove patch
@@ -2,13 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use Hborras\TwitterAdsSDK\TwitterAds;
4 4
 use Hborras\TwitterAdsSDK\TwitterAds\Analytics;
5
-use Hborras\TwitterAdsSDK\TwitterAds\Campaign\Campaign;
6 5
 use Hborras\TwitterAdsSDK\TwitterAds\Campaign\LineItem;
7
-use Hborras\TwitterAdsSDK\TwitterAds\Campaign\TargetingCriteria;
8
-use Hborras\TwitterAdsSDK\TwitterAds\Campaign\Tweet;
9
-use Hborras\TwitterAdsSDK\TwitterAds\Creative\PromotedTweet;
10
-use Hborras\TwitterAdsSDK\TwitterAds\Creative\WebsiteCard;
11
-use Hborras\TwitterAdsSDK\TwitterAds\Enumerations;
12 6
 
13 7
 require '../autoload.php';
14 8
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
 // Fetching stats for multiple line items
39 39
 $ids = array_map(
40
-    function ($o) {
40
+    function($o) {
41 41
         return $o->getId();
42 42
     },
43 43
     $lineItems->getCollection()
Please login to merge, or discard this patch.
examples/promoted_tweet.php 2 patches
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 use Hborras\TwitterAdsSDK\TwitterAds;
4
-use Hborras\TwitterAdsSDK\TwitterAds\Campaign\Campaign;
5
-use Hborras\TwitterAdsSDK\TwitterAds\Campaign\LineItem;
6
-use Hborras\TwitterAdsSDK\TwitterAds\Campaign\TargetingCriteria;
7 4
 use Hborras\TwitterAdsSDK\TwitterAds\Campaign\Tweet;
8 5
 use Hborras\TwitterAdsSDK\TwitterAds\Creative\PromotedTweet;
9 6
 use Hborras\TwitterAdsSDK\TwitterAds\Creative\WebsiteCard;
10
-use Hborras\TwitterAdsSDK\TwitterAds\Enumerations;
11 7
 
12 8
 require '../autoload.php';
13 9
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 const ACCOUNT_ID = 'account id';
19 19
 
20 20
 // Create twitter ads client
21
-$twitterAds = new TwitterAds(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_TOKEN,ACCESS_TOKEN_SECRET);
21
+$twitterAds = new TwitterAds(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
22 22
 
23 23
 // load up the account instance, campaign and line item
24 24
 $account = $twitterAds->getAccounts(ACCOUNT_ID);
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $lineItem = $account->getLineItems(null, ['campaign_ids' => $campaign->getId()])->next();
27 27
 
28 28
 // create request for a simple nullcasted tweet
29
-$tweet1 = Tweet::create($account,'There can be only one...  http://twitter.com');
29
+$tweet1 = Tweet::create($account, 'There can be only one...  http://twitter.com');
30 30
 
31 31
 // promote the tweet using our line item
32 32
 $promotedTweet = new PromotedTweet($account);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 // create request for a nullcasted tweet with a website card
38 38
 $websiteCard = new WebsiteCard($account);
39 39
 $websiteCard = $websiteCard->all()->next();
40
-$status = 'Fine. There can be two.  '. $websiteCard->getPreviewUrl();
40
+$status = 'Fine. There can be two.  '.$websiteCard->getPreviewUrl();
41 41
 $tweet2 = Tweet::create($account, $status);
42 42
 
43 43
 // Promote the tweet using our line item
Please login to merge, or discard this patch.
src/TwitterAds.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
      * @param string $host
342 342
      * @param string $path
343 343
      * @param array $parameters
344
-     * @return array|object
344
+     * @return resource
345 345
      * @throws BadRequest
346 346
      * @throws Forbidden
347 347
      * @throws NotAuthorized
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
     /**
538 538
      * Return current response. Allows inheritance.
539 539
      *
540
-     * @return string
540
+     * @return Response
541 541
      */
542 542
     public function getResponse()
543 543
     {
Please login to merge, or discard this patch.
src/TwitterAds/Account.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     /**
61 61
      * Returns an object instance for a given resource.
62 62
      *
63
-     * @param $id
63
+     * @param string $id
64 64
      * @param array $params
65 65
      *
66 66
      * @return $this
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@
 block discarded – undo
187 187
     }
188 188
 
189 189
 
190
-    public function getTailoredAudiences($id = '',  $params = [])
190
+    public function getTailoredAudiences($id = '', $params = [])
191 191
     {
192 192
         // TODO: Next Release
193 193
     }
Please login to merge, or discard this patch.
src/TwitterAds/Cursor.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     }
38 38
 
39 39
     /**
40
-     * @return mixed
40
+     * @return integer
41 41
      */
42 42
     public function count()
43 43
     {
Please login to merge, or discard this patch.
src/TwitterAds/Resource.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
     /**
56 56
      * Returns an object instance for a given resource.
57 57
      *
58
-     * @param $id
58
+     * @param string $id
59 59
      * @param $params
60 60
      *
61
-     * @return resource
61
+     * @return Resource
62 62
      */
63 63
     public function load($id, $params = [])
64 64
     {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      *
75 75
      * @param $params
76 76
      *
77
-     * @return resource
77
+     * @return Resource
78 78
      *
79 79
      * @throws TwitterAdsException
80 80
      */
Please login to merge, or discard this patch.
examples/quick_start.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 const ACCOUNT_ID = 'account id';
16 16
 
17 17
 // Create twitter ads client
18
-$twitterAds = new TwitterAds(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_TOKEN,ACCESS_TOKEN_SECRET);
18
+$twitterAds = new TwitterAds(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
19 19
 
20 20
 // Retrieve account information
21 21
 $account = $twitterAds->getAccounts(ACCOUNT_ID);
Please login to merge, or discard this patch.
autoload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
  * @param string $class The fully-qualified class name.
7 7
  * @return void
8 8
  */
9
-spl_autoload_register(function ($class) {
9
+spl_autoload_register(function($class) {
10 10
 
11 11
     // project-specific namespace prefix
12 12
     $prefix = 'Hborras\\TwitterAdsSDK\\';
13 13
 
14 14
     // base directory for the namespace prefix
15
-    $base_dir = __DIR__ . '/src/';
15
+    $base_dir = __DIR__.'/src/';
16 16
 
17 17
     // does the class use the namespace prefix?
18 18
     $len = strlen($prefix);
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     // replace the namespace prefix with the base directory, replace namespace
28 28
     // separators with directory separators in the relative class name, append
29 29
     // with .php
30
-    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
30
+    $file = $base_dir.str_replace('\\', '/', $relative_class).'.php';
31 31
 
32 32
     // if the file exists, require it
33 33
     if (file_exists($file)) {
Please login to merge, or discard this patch.