Skip to content

Commit

Permalink
Apply PSR2 code sniffing rules
Browse files Browse the repository at this point in the history
  • Loading branch information
shulard committed Apr 5, 2016
1 parent 46aca35 commit f386e48
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,12 @@ private function rawCall($method, $path, $content = null, $is_authenticated = tr
$body = null;

if (isset($content) && $method == 'GET') {

$query_string = $uri->getQuery();

$query = array();
if (!empty($query_string)) {
$queries = explode('&', $query_string);
foreach($queries as $element) {
foreach ($queries as $element) {
$key_value_query = explode('=', $element, 2);
$query[$key_value_query[0]] = $key_value_query[1];
}
Expand All @@ -243,14 +242,10 @@ private function rawCall($method, $path, $content = null, $is_authenticated = tr
$query = array_merge($query, (array)$content);

// rewrite query args to properly dump true/false parameters
foreach($query as $key => $value)
{
if ($value === false)
{
foreach ($query as $key => $value) {
if ($value === false) {
$query[$key] = "false";
}
elseif ($value === true)
{
} elseif ($value === true) {
$query[$key] = "true";
}
}
Expand Down

0 comments on commit f386e48

Please sign in to comment.