Skip to content

Commit

Permalink
Merge branch 'QA_2_4'
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetx committed Jun 21, 2013
2 parents 3e2e283 + 53d7b60 commit a4c5821
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ codebird-php - changelog

2.5.0 (not yet released)

2.4.1 (not yet released)
+ #26 Stringify null and boolean parameters

2.4.0 (2013-06-15)
+ Add contributing guidelines
+ rfe #21 JSON return format
Expand Down
13 changes: 13 additions & 0 deletions src/codebird.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,19 @@ public function __call($fn, $params)
}
}
}

// stringify null and boolean parameters
foreach ($apiparams as $key => $value) {
if (! is_scalar($value)) {
continue;
}
if (is_null($value)) {
$apiparams[$key] = 'null';
} elseif (is_bool($value)) {
$apiparams[$key] = $value ? 'true' : 'false';
}
}

$app_only_auth = false;
if (count($params) > 1) {
$app_only_auth = !! $params[1];
Expand Down

0 comments on commit a4c5821

Please sign in to comment.