Skip to content

Commit

Permalink
Merge pull request #72 from hborras/temp-v6
Browse files Browse the repository at this point in the history
Temp v6
  • Loading branch information
hborras authored Mar 5, 2020
2 parents 37c2912 + 2bde6e6 commit 5575342
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DS_Store
composer.lock
vendor
tests/env
tests/.env
.idea
private_examples/*
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: php
php:
- 7.4
- 7.3
- 7.2
- 7.1
sudo: false
before_script:
- composer self-update
Expand Down
2 changes: 1 addition & 1 deletion src/SignatureMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function checkSignature(Request $request, Consumer $consumer, Token $toke
// Avoid a timing leak with a (hopefully) time insensitive compare
$result = 0;
for ($i = 0, $iMax = strlen($signature); $i < $iMax; ++$i) {
$result |= ord($built{$i}) ^ ord($signature{$i});
$result |= ord($built[$i]) ^ ord($signature[$i]);
}

return $result == 0;
Expand Down
2 changes: 1 addition & 1 deletion src/TwitterAds.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
class TwitterAds extends Config
{
const API_VERSION = '5';
const API_VERSION = '6';
const API_REST_VERSION = '1.1';
const API_HOST = 'https://ads-api.twitter.com';
const API_HOST_SANDBOX = 'https://ads-api-sandbox.twitter.com';
Expand Down
30 changes: 0 additions & 30 deletions src/TwitterAds/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,36 +269,6 @@ public function getVideos($id = '', $params = [])
return $videoClass->loadResource($id, $params);
}

/**
* Returns the most recent promotable Tweets created by one or more specified Twitter users.
*
* @param $ids
* @param $params
* @return
* @throws Errors\BadRequest
* @throws Errors\Forbidden
* @throws Errors\NotAuthorized
* @throws Errors\NotFound
* @throws Errors\RateLimit
* @throws Errors\ServerError
* @throws Errors\ServiceUnavailable
* @throws TwitterAdsException
*/
public function getScopedTimeline($ids, $params)
{
$this->validateLoaded();

if (is_array($ids)) {
$ids = implode(',', $ids);
}
$params[] = [AccountFields::USER_IDS => $ids];

$resource = str_replace(self::RESOURCE_REPLACE, $this->getId(), self::SCOPED_TIMELINE);
$response = $this->getTwitterAds()->get($resource, $params);

return $response->getBody()->data;
}

/**
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/TwitterAds/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ abstract class Resource implements Arrayable
const RESOURCE_ID_REPLACE = '{id}';
const RESOURCE_REPLACE = '{account_id}';

private $properties = [];
protected $properties = [];

/** @var TwitterAds $twitterAds */
private $twitterAds;
Expand Down
18 changes: 0 additions & 18 deletions tests/TwitterAds/AccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ public function testGetFeatures(Account $account)
$this->assertGreaterThan(0, count($features));
}

/**
* @depends testGetAccount
* @param Account $account
* @throws TwitterAds\Errors\BadRequest
* @throws TwitterAds\Errors\Forbidden
* @throws TwitterAds\Errors\NotAuthorized
* @throws TwitterAds\Errors\NotFound
* @throws TwitterAds\Errors\RateLimit
* @throws TwitterAds\Errors\ServerError
* @throws TwitterAds\Errors\ServiceUnavailable
* @throws TwitterAdsException
*/
public function testScopedTimeline(Account $account)
{
$scopedTimeline = $account->getScopedTimeline(null, null);
$this->assertGreaterThan(0, count($scopedTimeline));
}

/**
* @depends testGetAccount
* @param Account $account
Expand Down

0 comments on commit 5575342

Please sign in to comment.