8000 Merge branch 'QA_2_4' · codezninja/codebird-php@a4c5821 · GitHub
[go: up one dir, main page]

Skip to content

Commit a4c5821

Browse files
committed
Merge branch 'QA_2_4'
2 parents 3e2e283 + 53d7b60 commit a4c5821

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ codebird-php - changelog
33

44
2.5.0 (not yet released)
55

6+
2.4.1 (not yet released)
7+
+ #26 Stringify null and boolean parameters
8+
69
2.4.0 (2013-06-15)
710
+ Add contributing guidelines
811
+ rfe #21 JSON return format

src/codebird.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,19 @@ public function __call($fn, $params)
217217
}
218218
}
219219
}
220+
221+
// stringify null and boolean parameters
222+
foreach ($apiparams as $key => $value) {
223+
if (! is_scalar($value)) {
224+
continue;
225+
}
226+
if (is_null($value)) {
227+
$apiparams[$key] = 'null';
228+
} elseif (is_bool($value)) {
229+
$apiparams[$key] = $value ? 'true' : 'false';
230+
}
231+
}
232+
220233
$app_only_auth = false;
221234
if (count($params) > 1) {
222235
$app_only_auth = !! $params[1];

0 commit comments

Comments
 (0)
0