lib/Core/ApiClient.php
private function castBooleanValuesToStrings($query)
    {
        return array_map(
            function ($value) {
                if ($value === true) {
                    return "true";
                } elseif ($value === false) {
                    return "false";
                } elseif (is_array($value)) {
                    return $this->castBooleanValuesToStrings($value);
                } else {
                    return $value;
                }
            }, $query
        );
    }
private function castBooleanValuesToStrings($query)
    {
        return array_map(
            function ($value) {
                if ($value === true) {
                    return "true";
                } elseif ($value === false) {
                    return "false";
                } elseif (is_array($value)) {
                    return $this->castBooleanValuesToStrings($value);
                } else {
                    return $value;
                }
            }, $query
        );
    }
private function castBooleanValuesToStrings ( $ query ) { return array_map ( function ( $ value ) { if ( $ value === true ) { return "true" ; } elseif ( $ value === false ) { return "false" ; } elseif ( is_array ( $ value ) ) { return $ this -> castBooleanValuesToStrings ( $ value ) ; } else { return $ value ; } } , $ query ) ; }
Recursively maps through an array, casting any booleans to strings, where
true should be casted as "true", and false as "false". We use this to
prepare query parameters to be sent to the API, since PHP's in-build
http_build_query casts booleans as "1" and "" respectively, which is odd.

@param array $query An array to map through, casting booleans to strings

@return array The new array with booleans casted to strings
Recursively maps through an array casting any booleans to strings where true should be casted as true and false as false . We use this to prepare query parameters to be sent to the API since PHP s in - build http_build_query casts booleans as 1 and respectively which is odd .