private function prepareData()
    {
        $data = [];
        foreach (get_object_vars($this) as $property => $value) {
            if (in_array($property, ['apiHost', 'debug'])) {
                continue;
            }

            if ($property == 'format') {
                $data[$value] = '';
            } elseif (is_bool($value) && $value) {
                $data[$property] = '';
            } elseif (!is_null($value) && !is_bool($value)) {
                if (is_array($value)) {
                    foreach ($value as $key => $val) {
                        $value[$key] = $val;
                    }
                } else {
                    $value = $value;
                }

                $data[$property] = $value;
            }
        }

        if (empty($data) && $this->debug) {
            throw new \Exception('Query have not data');
        }

        $data = http_build_query($data);

        return $data;
    }
private function prepareData()
    {
        $data = [];
        foreach (get_object_vars($this) as $property => $value) {
            if (in_array($property, ['apiHost', 'debug'])) {
                continue;
            }

            if ($property == 'format') {
                $data[$value] = '';
            } elseif (is_bool($value) && $value) {
                $data[$property] = '';
            } elseif (!is_null($value) && !is_bool($value)) {
                if (is_array($value)) {
                    foreach ($value as $key => $val) {
                        $value[$key] = $val;
                    }
                } else {
                    $value = $value;
                }

                $data[$property] = $value;
            }
        }

        if (empty($data) && $this->debug) {
            throw new \Exception('Query have not data');
        }

        $data = http_build_query($data);

        return $data;
    }
private function prepareData ( ) { $ data = [ ] ; foreach ( get_object_vars ( $ this ) as $ property => $ value ) { if ( in_array ( $ property , [ 'apiHost' , 'debug' ] ) ) { continue ; } if ( $ property == 'format' ) { $ data [ $ value ] = '' ; } elseif ( is_bool ( $ value ) && $ value ) { $ data [ $ property ] = '' ; } elseif ( ! is_null ( $ value ) && ! is_bool ( $ value ) ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ key => $ val ) { $ value [ $ key ] = $ val ; } } else { $ value = $ value ; } $ data [ $ property ] = $ value ; } } if ( empty ( $ data ) && $ this -> debug ) { throw new \ Exception ( 'Query have not data' ) ; } $ data = http_build_query ( $ data ) ; return $ data ; }
Preparing data before request

@return string
@throws \Exception
Preparing data before request