10000 Merge branch 'develop' into release/3.2.0 · BearerPipelineTest/codebird-php@a371471 · GitHub
[go: up one dir, main page]

Skip to content

Commit a371471

Browse files
committed
Merge branch 'develop' into release/3.2.0
2 parents 1356320 + 23f346f commit a371471

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ GNU General Public License for more details.
1717
You should have received a copy of the GNU General Public License
1818
along with this program. If not, see <http://www.gnu.org/licenses/>.
1919

20+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3cd81a521d334648b9958327621a3070)](https://www.codacy.com/app/jublonet/codebird-php?utm_source=github.com&utm_medium=referral&utm_content=jublonet/codebird-php&utm_campaign=badger)
2021
[![Coverage Status](https://img.shields.io/coveralls/jublonet/codebird-php/develop.svg)](https://coveralls.io/github/jublonet/codebird-php?branch=develop)
2122
[![Travis Status](https://img.shields.io/travis/jublonet/codebird-php/develop.svg)](https://travis-ci.org/jublonet/codebird-php/branches)
2223

src/codebird.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ class Codebird
430430
'statuses/update_with_media', // deprecated, use media/upload
431431
'ton/bucket/:bucket',
432432
'ton/bucket/:bucket?resumable=true',
433+
'tweets/search/30day/:env',
433434
'users/lookup',
434435
'users/report_spam'
435436
],
@@ -1930,11 +1931,11 @@ protected function _detectMedia($method) {
19301931
/**
19311932
* Detects if API call should use JSON body
19321933
*
1933-
* @param string $method The API method to call
1934+
* @param string $method_template The API method to call
19341935
*
19351936
* @return bool Whether the method is defined as accepting JSON body
19361937
*/
1937-
protected function _detectJsonBody($method) {
1938+
protected function _detectJsonBody($method_template) {
19381939
$json_bodies = [
19391940
'ads/batch/accounts/:account_id/campaigns',
19401941
'ads/batch/accounts/:account_id/line_items',
@@ -1943,9 +1944,10 @@ protected function _detectJsonBody($method) {
19431944
'ads/sandbox/batch/accounts/:account_id/line_items',
19441945
'ads/sandbox/batch/accounts/:account_id/targeting_criteria',
19451946
'collections/entries/curate',
1946-
'media/metadata/create'
1947+
'media/metadata/create',
1948+
'tweets/search/30day/:env'
19471949
];
1948-
return in_array($method, $json_bodies);
1950+
return in_array($method_template, $json_bodies);
19491951
}
19501952

19511953
/**
@@ -2224,7 +2226,7 @@ protected function _callApiPreparationsPost(
22242226
$multipart_boundary = substr($params, 2, $first_newline - 2);
22252227
$request_headers[] = 'Content-Type: multipart/form-data; boundary='
22262228
. $multipart_boundary;
2227-
} elseif ($this->_detectJsonBody($method)) {
2229+
} elseif ($this->_detectJsonBody($method_template)) {
22282230
$authorization = $this->_sign($httpmethod, $url, []);
22292231
$params = json_encode($params);
22302232
$request_headers[] = 'Content-Type: application/json';

0 commit comments

Comments
 (0)
0